Closed Bug 328066 Opened 19 years ago Closed 19 years ago

implement bzip2 compression for sending metrics log

Categories

(Toolkit Graveyard :: Data Collection/Metrics, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.8.1

People

(Reporter: bryner, Assigned: darin.moz)

Details

Attachments

(1 file)

-> me
Assignee: nobody → darin
Status: NEW → ASSIGNED
Priority: -- → P1
Depends on: 328126
QA Contact: nobody → metrics
Attached patch v1 patchSplinter Review
Attachment #213403 - Flags: first-review?(bryner)
I decided to go the simple route for now and just statically link in the bzip2 library. I'll probably revise this code once Necko provides a generic compression API.
No longer depends on: 328126
Comment on attachment 213403 [details] [diff] [review] v1 patch >--- src/nsMetricsService.cpp 21 Feb 2006 19:36:50 -0000 1.3 >+++ src/nsMetricsService.cpp 28 Feb 2006 02:36:33 -0000 >@@ -135,94 +143,156 @@ nsMetricsService::LogEvent(const nsAStri >+NS_IMETHODIMP >+nsMetricsService::Flush() >+{ ... >+ PR_Close(fd); >+ NS_ENSURE_STATE(succeeded); >+ >+ // Create a new mRoot >+ rv = CreateRoot(); >+ NS_ENSURE_SUCCESS(rv, rv); >+ So if writing the data fails for some reason, this will make us retain the data in memory. I guess that's probably the best way to handle it, since it could be a temporary failure of some sort. >@@ -233,20 +303,51 @@ nsMetricsService::Observe(nsISupports *s >+/*static*/ NS_METHOD >+nsMetricsService::Create(nsISupports *outer, const nsIID &iid, void **result) >+{ It's not clear to me what this gets us that NS_GENERIC_FACTORY_CONSTRUCTOR_INIT doesn't. Looks ok otherwise.
Attachment #213403 - Flags: first-review?(bryner) → first-review+
> So if writing the data fails for some reason, this will make us retain the > data in memory. I guess that's probably the best way to handle it, since it > could be a temporary failure of some sort. Yeah, that's true. I think it's okay. > >@@ -233,20 +303,51 @@ nsMetricsService::Observe(nsISupports *s > >+/*static*/ NS_METHOD > >+nsMetricsService::Create(nsISupports *outer, const nsIID &iid, void **result) > >+{ > > It's not clear to me what this gets us that NS_GENERIC_FACTORY_CONSTRUCTOR_INIT > doesn't. I can't use nsMetricsService::get() with NS_GENERIC_FACTORY_CONSTRUCTOR_INIT because nsMetricsService::get() calls do_GetService. The result would be infinite recursion. I wrote it that way once before arriving at the current solution. I'll add a comment if you want ;-)
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
doesn't public/nsIMetricsService.idl need a new IID?
I didn't bother since we haven't released any software with this code. It isn't built by default.
No longer blocks: 328064
Flags: first-review+
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: