MaxSem has submitted this change and it was merged.

Change subject: Ensure all metrics are logged with the same time
......................................................................


Ensure all metrics are logged with the same time

Bug: T144652
Change-Id: Ic860e95a88ce198be1f3c2868e6296ecef2dd5e4
(cherry picked from commit e74ff2ca4231bce1784ca718d1d2a239fd8cf6ef)
---
M tracking-category-count.php
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  MaxSem: Verified; Looks good to me, approved



diff --git a/tracking-category-count.php b/tracking-category-count.php
index d5fbdfb..a9030e0 100644
--- a/tracking-category-count.php
+++ b/tracking-category-count.php
@@ -16,13 +16,14 @@
 
 function recordToGraphite( $wiki, $metric, $count ) {
     global $config, $debug;
+    static $timestamp = time();
 
     if ( !$config->graphiteHost || !$config->graphitePort ) {
         return;
     }
 
     $key = str_replace( '%WIKI%', $wiki, $config->categories[$metric] );
-    $packet = "$key $count `date +%s`";
+    $packet = "$key $count $timestamp";
     $nc = "nc -q0 {$config->graphiteHost} {$config->graphitePort}";
     $command = "echo \"$packet\" | $nc";
 

-- 
To view, visit https://gerrit.wikimedia.org/r/310691
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic860e95a88ce198be1f3c2868e6296ecef2dd5e4
Gerrit-PatchSet: 1
Gerrit-Project: analytics/discovery-stats
Gerrit-Branch: production
Gerrit-Owner: MaxSem <maxsem.w...@gmail.com>
Gerrit-Reviewer: MaxSem <maxsem.w...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to