summaryrefslogtreecommitdiff
path: root/startupcache
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-11-01 14:48:34 +0000
committerMoonchild <moonchild@palemoon.org>2022-04-02 14:49:45 +0200
commit534de5cc5b76f3f8556b8a5c318cde7a5bb93c3d (patch)
tree1d0cebb83ce88607d10f7543e9defeeb715d1ccc /startupcache
parent023a71c6f2007eb08116ce539920f7cd11d52d8d (diff)
downloaduxp-534de5cc5b76f3f8556b8a5c318cde7a5bb93c3d.tar.gz
Issue #21 - Remove remaining telemetry structs, callers and flags.
Diffstat (limited to 'startupcache')
-rw-r--r--startupcache/StartupCache.cpp13
-rw-r--r--startupcache/StartupCache.h2
-rw-r--r--startupcache/nsIStartupCache.idl4
-rw-r--r--startupcache/test/TestStartupCache.cpp50
-rw-r--r--startupcache/test/TestStartupCacheTelemetry.js60
-rw-r--r--startupcache/test/TestStartupCacheTelemetry.manifest2
-rw-r--r--startupcache/test/moz.build4
7 files changed, 0 insertions, 135 deletions
diff --git a/startupcache/StartupCache.cpp b/startupcache/StartupCache.cpp
index 9b99e6ac42..4eec8daedb 100644
--- a/startupcache/StartupCache.cpp
+++ b/startupcache/StartupCache.cpp
@@ -596,13 +596,6 @@ StartupCache::ResetStartupWriteTimer()
return NS_OK;
}
-nsresult
-StartupCache::RecordAgesAlways()
-{
- gPostFlushAgeAction = RECORD_AGE;
- return NS_OK;
-}
-
// StartupCacheDebugOutputStream implementation
#ifdef DEBUG
NS_IMPL_ISUPPORTS(StartupCacheDebugOutputStream, nsIObjectOutputStream,
@@ -798,11 +791,5 @@ StartupCacheWrapper::GetObserver(nsIObserver** obv) {
return NS_OK;
}
-nsresult
-StartupCacheWrapper::RecordAgesAlways() {
- StartupCache *sc = StartupCache::GetSingleton();
- return sc ? sc->RecordAgesAlways() : NS_ERROR_NOT_INITIALIZED;
-}
-
} // namespace scache
} // namespace mozilla
diff --git a/startupcache/StartupCache.h b/startupcache/StartupCache.h
index be428c004e..1a2ce0e0bd 100644
--- a/startupcache/StartupCache.h
+++ b/startupcache/StartupCache.h
@@ -129,8 +129,6 @@ public:
nsresult GetDebugObjectOutputStream(nsIObjectOutputStream* aStream,
nsIObjectOutputStream** outStream);
- nsresult RecordAgesAlways();
-
static StartupCache* GetSingleton();
static void DeleteSingleton();
diff --git a/startupcache/nsIStartupCache.idl b/startupcache/nsIStartupCache.idl
index b03dcb3ccd..0b629f2615 100644
--- a/startupcache/nsIStartupCache.idl
+++ b/startupcache/nsIStartupCache.idl
@@ -55,10 +55,6 @@ interface nsIStartupCache : nsISupports
boolean startupWriteComplete();
void resetStartupWriteTimer();
- /* Instruct clients to always post cache ages to Telemetry, even in
- cases where it would not normally make sense. */
- void recordAgesAlways();
-
/* Allows clients to simulate the behavior of ObserverService. */
readonly attribute nsIObserver observer;
};
diff --git a/startupcache/test/TestStartupCache.cpp b/startupcache/test/TestStartupCache.cpp
index a16c2de727..dac85f9bea 100644
--- a/startupcache/test/TestStartupCache.cpp
+++ b/startupcache/test/TestStartupCache.cpp
@@ -410,54 +410,10 @@ int main(int argc, char** argv)
int rv = 0;
nsresult scrv;
- // Register TestStartupCacheTelemetry
- nsCOMPtr<nsIFile> manifest;
- scrv = NS_GetSpecialDirectory(NS_GRE_DIR,
- getter_AddRefs(manifest));
- if (NS_FAILED(scrv)) {
- fail("NS_XPCOM_CURRENT_PROCESS_DIR");
- return 1;
- }
-
-#ifdef XP_MACOSX
- nsCOMPtr<nsIFile> tempManifest;
- manifest->Clone(getter_AddRefs(tempManifest));
- manifest->AppendNative(
- NS_LITERAL_CSTRING("TestStartupCacheTelemetry.manifest"));
- bool exists;
- manifest->Exists(&exists);
- if (!exists) {
- // Workaround for bug 1080338 in mozharness.
- manifest = tempManifest.forget();
- manifest->SetNativeLeafName(NS_LITERAL_CSTRING("MacOS"));
- manifest->AppendNative(
- NS_LITERAL_CSTRING("TestStartupCacheTelemetry.manifest"));
- }
-#else
- manifest->AppendNative(
- NS_LITERAL_CSTRING("TestStartupCacheTelemetry.manifest"));
-#endif
-
- XRE_AddManifestLocation(NS_APP_LOCATION, manifest);
-
- nsCOMPtr<nsIObserver> telemetryThing =
- do_GetService("@mozilla.org/testing/startup-cache-telemetry.js");
- if (!telemetryThing) {
- fail("telemetryThing");
- return 1;
- }
- scrv = telemetryThing->Observe(nullptr, "save-initial", nullptr);
- if (NS_FAILED(scrv)) {
- fail("save-initial");
- rv = 1;
- }
-
nsCOMPtr<nsIStartupCache> sc
= do_GetService("@mozilla.org/startupcache/cache;1", &scrv);
if (NS_FAILED(scrv))
rv = 1;
- else
- sc->RecordAgesAlways();
if (NS_FAILED(TestStartupWriteRead()))
rv = 1;
if (NS_FAILED(TestWriteInvalidateRead()))
@@ -470,11 +426,5 @@ int main(int argc, char** argv)
if (NS_FAILED(TestEarlyShutdown()))
rv = 1;
- scrv = telemetryThing->Observe(nullptr, "save-initial", nullptr);
- if (NS_FAILED(scrv)) {
- fail("check-final");
- rv = 1;
- }
-
return rv;
}
diff --git a/startupcache/test/TestStartupCacheTelemetry.js b/startupcache/test/TestStartupCacheTelemetry.js
deleted file mode 100644
index 7a570187fd..0000000000
--- a/startupcache/test/TestStartupCacheTelemetry.js
+++ /dev/null
@@ -1,60 +0,0 @@
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-function shouldHaveChanged(a, b)
-{
- if (a.length != b.length) {
- throw Error("TEST-UNEXPECTED-FAIL: telemetry count array size changed");
- }
-
- for (let i = 0; i < a.length; ++i) {
- if (a[i] == b[i]) {
- continue;
- }
- return; // something was different, that's all that matters
- }
- throw Error("TEST-UNEXPECTED-FAIL: telemetry data didn't change");
-}
-
-function TestStartupCacheTelemetry() { }
-
-TestStartupCacheTelemetry.prototype = {
- classID: Components.ID("{73cbeffd-d6c7-42f0-aaf3-f176430dcfc8}"),
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
-
- saveInitial: function() {
- let t = Services.telemetry;
- this._age = t.getHistogramById("STARTUP_CACHE_AGE_HOURS").snapshot.counts;
- this._invalid = t.getHistogramById("STARTUP_CACHE_INVALID").snapshot.counts;
- },
-
- checkFinal: function() {
- let t = Services.telemetry;
- let newAge = t.getHistogramById("STARTUP_CACHE_AGE_HOURS").snapshot.counts;
- shouldHaveChanged(this._age, newAge);
-
- let newInvalid = t.getHistogramById("STARTUP_CACHE_INVALID").snapshot.counts;
- shouldHaveChanged(this._invalid, newInvalid);
- },
-
- observe: function(subject, topic, data) {
- switch (topic) {
- case "save-initial":
- this.saveInitial();
- break;
-
- case "check-final":
- this.checkFinal();
- break;
-
- default:
- throw Error("BADDOG, NO MILKBONE FOR YOU");
- }
- },
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TestStartupCacheTelemetry]);
diff --git a/startupcache/test/TestStartupCacheTelemetry.manifest b/startupcache/test/TestStartupCacheTelemetry.manifest
deleted file mode 100644
index b288a72928..0000000000
--- a/startupcache/test/TestStartupCacheTelemetry.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {73cbeffd-d6c7-42f0-aaf3-f176430dcfc8} TestStartupCacheTelemetry.js
-contract @mozilla.org/testing/startup-cache-telemetry.js {73cbeffd-d6c7-42f0-aaf3-f176430dcfc8}
diff --git a/startupcache/test/moz.build b/startupcache/test/moz.build
index 1f5ac1c610..7aae3d8718 100644
--- a/startupcache/test/moz.build
+++ b/startupcache/test/moz.build
@@ -7,7 +7,3 @@ GeckoCppUnitTests([
'TestStartupCache',
])
-EXTRA_COMPONENTS += [
- 'TestStartupCacheTelemetry.js',
- 'TestStartupCacheTelemetry.manifest',
-]