Bug 1345108 - Reduce resolution for timestamp in crashreporter's crash pings. r?ted
MozReview-Commit-ID: 5BA51mWlkqW
--- a/toolkit/components/telemetry/docs/data/crash-ping.rst
+++ b/toolkit/components/telemetry/docs/data/crash-ping.rst
@@ -65,16 +65,21 @@ Structure:
TotalVirtualMemory: <size>, // Windows-only, virtual memory in use
UptimeTS: <duration>, // Seconds since Firefox was started
User32BeforeBlocklist: 1, // Windows-only, present only if user32.dll was loaded before the DLL blocklist has been initialized
},
hasCrashEnvironment: bool
}
}
+.. note::
+
+ For "crash" pings generated by the crashreporter we are deliberately truncating the ``creationDate``
+ to hours. See bug 1345108 for context.
+
Process Types
-------------
The ``processType`` field contains the type of process that crashed. There are
currently multiple process types defined in ``nsICrashService`` but crash pings
are sent only for the ones below:
+---------------+---------------------------------------------------+
--- a/toolkit/crashreporter/client/ping.cpp
+++ b/toolkit/crashreporter/client/ping.cpp
@@ -90,22 +90,21 @@ GenerateUUID()
return "";
}
return str;
}
const char kISO8601Date[] = "%F";
const char kISO8601DateHours[] = "%FT%H:00:00.000Z";
-const char kISO8601FullDate[] = "%FT%T.000Z";
// Return the current date as a string in the specified format, the following
// constants are provided:
// - kISO8601Date, the ISO 8601 date format, YYYY-MM-DD
-// - kISO8601FullDate, the ISO 8601 full date format, YYYY-MM-DDTHH:MM:SS.000Z
+// - kISO8601DateHours, the ISO 8601 full date format, YYYY-MM-DDTHH:00:00.000Z
static string
CurrentDate(string format)
{
time_t now;
time(&now);
char buf[64]; // This should be plenty
strftime(buf, sizeof buf, format.c_str(), gmtime(&now));
return buf;
@@ -225,17 +224,17 @@ CreateRootNode(StringTable& strings, con
const string& aClientId, const string& aSessionId,
const string& aName, const string& aVersion,
const string& aChannel, const string& aBuildId)
{
Json::Value root;
root["type"] = "crash"; // This is a crash ping
root["id"] = aUuid;
root["version"] = kTelemetryVersion;
- root["creationDate"] = CurrentDate(kISO8601FullDate);
+ root["creationDate"] = CurrentDate(kISO8601DateHours);
root["clientId"] = aClientId;
// Parse the telemetry environment
Json::Value environment;
Json::Reader reader;
string architecture;
string xpcomAbi;