change <load> event to <document action='load'> for consistency (bug 330711). r=marria

This commit is contained in:
bryner%brianryner.com 2006-03-25 02:34:17 +00:00
Родитель 111cf37ffb
Коммит 0ec527b6ae
4 изменённых файлов: 10 добавлений и 5 удалений

Просмотреть файл

@ -256,8 +256,13 @@ nsLoadCollector::OnStateChange(nsIWebProgress *webProgress,
} else if (flags & STATE_STOP) {
RequestEntry entry;
if (mRequestMap.Get(request, &entry)) {
nsHashPropertyBag *props = entry.properties;
// Log a <document action="load"> event
nsHashPropertyBag *props = entry.properties;
rv = props->SetPropertyAsACString(NS_LITERAL_STRING("action"),
NS_LITERAL_CSTRING("load"));
NS_ENSURE_SUCCESS(rv, rv);
// Compute the load time now that we have the end time.
PRInt64 loadTime = (PR_Now() - entry.startTime) / PR_USEC_PER_MSEC;
rv = props->SetPropertyAsUint64(NS_LITERAL_STRING("loadtime"), loadTime);
@ -272,7 +277,7 @@ nsLoadCollector::OnStateChange(nsIWebProgress *webProgress,
}
nsMetricsService *ms = nsMetricsService::get();
rv = ms->LogEvent(NS_LITERAL_STRING("load"), props);
rv = ms->LogEvent(NS_LITERAL_STRING("document"), props);
mRequestMap.Remove(request);
NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -42,7 +42,7 @@
// This file defines the load collector class, which monitors requests using
// the document loader service and records the events into the metrics service.
//
// The load collector logs <load/> events.
// The load collector logs <document action="load"/> events.
// This event has the following attributes:
//
// origin: The action which initiated the load (string). Possible values are:

Просмотреть файл

@ -97,7 +97,7 @@ nsMetricsConfig::Load(nsIFile *file)
// xmlns:foo="http://foo.com/metrics">
// <collectors>
// <collector type="ui"/>
// <collector type="load"/>
// <collector type="document"/>
// <collector type="window"/>
// <collector type="foo:mystat"/>
// </collectors>

Просмотреть файл

@ -367,7 +367,7 @@ nsMetricsService::EnableCollectors()
//
nsresult rv;
if (mConfig.IsEventEnabled(NS_LITERAL_STRING(NS_METRICS_NAMESPACE),
NS_LITERAL_STRING("load"))) {
NS_LITERAL_STRING("document"))) {
rv = nsLoadCollector::Startup();
NS_ENSURE_SUCCESS(rv, rv);
} else {