diff --git a/server/src/Domain/Technical/Service/InfluxDBMetricsFormatter.php b/server/src/Domain/Technical/Service/InfluxDBMetricsFormatter.php index 440b2718..1e8f5860 100644 --- a/server/src/Domain/Technical/Service/InfluxDBMetricsFormatter.php +++ b/server/src/Domain/Technical/Service/InfluxDBMetricsFormatter.php @@ -24,13 +24,6 @@ public function format(array $toFormat, string $baseUrl, string $appEnv): string } } - return $formattedAsInflux . ' ' . implode(',', $metricsToGlue) . ' ' . $this->getCurrentTimestamp() . 'us'; - } - - private function getCurrentTimestamp(): string - { - list($uSec, $sec) = explode(' ', microtime()); - - return sprintf('%d%06d', $sec, $uSec*1000000); + return $formattedAsInflux . ' ' . implode(',', $metricsToGlue); } } diff --git a/server/tests/Domain/Technical/Service/InfluxDBMetricsFormatterTest.php b/server/tests/Domain/Technical/Service/InfluxDBMetricsFormatterTest.php index d358fa89..af6765dc 100644 --- a/server/tests/Domain/Technical/Service/InfluxDBMetricsFormatterTest.php +++ b/server/tests/Domain/Technical/Service/InfluxDBMetricsFormatterTest.php @@ -40,16 +40,6 @@ public function testAppEnvAndBaseUrlArePresentAsTags(): void $formatter = new InfluxDBMetricsFormatter(); $formatted = $formatter->format(['data' => []], 'http://localhost', 'test'); - $this->assertStringContainsString('backup_repository_report,base_url="http://localhost",app_env="test" ', $formatted); - } - - public function testTimestampIsPresentAtTheEndOfMetricString(): void - { - $formatter = new InfluxDBMetricsFormatter(); - $formatted = $formatter->format(['data' => []], 'http://localhost', 'test'); - - $exp = explode(' ', $formatted); - - $this->assertIsNumeric(str_replace('us', '', $exp[count($exp) - 1])); + $this->assertStringContainsString('backup_repository_report,base_url="http://localhost",app_env="test" ', $formatted); } }