Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/FailedProcesses/src/Service/ProcessTracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

class ProcessTracker implements MetricsProviderInterface
{
private const PROCESS_TRACKING_DIR = 'data/process-tracking/';
protected const PROCESS_TRACKING_DIR = 'data/process-tracking/';

private const ENV_TRACK_PROCESSES = 'TRACK_PROCESSES';
protected const ENV_TRACK_PROCESSES = 'TRACK_PROCESSES';

/** @var string */
private static $filePath;
protected static $filePath;

/**
* TODO: make $lifeCycleToken optional
Expand Down Expand Up @@ -153,7 +153,7 @@ public static function getAllData(): array
return $data;
}

private static function parseFileData(string $fileData): array
protected static function parseFileData(string $fileData): array
{
$lines = explode("\n", $fileData);

Expand Down Expand Up @@ -187,7 +187,7 @@ private static function parseFileData(string $fileData): array
];
}

private static function getFailedProcessesCount(int $passedMinutes, bool $onlyToday = true): int
protected static function getFailedProcessesCount(int $passedMinutes, bool $onlyToday = true): int
{
$dirPath = static::getProcessTrackingDir();

Expand All @@ -208,7 +208,7 @@ private static function getFailedProcessesCount(int $passedMinutes, bool $onlyTo
return (int)$filesCount;
}

private static function getServiceName(): string
protected static function getServiceName(): string
{
$serviceName = exec('hostname');

Expand All @@ -225,17 +225,17 @@ private static function getServiceName(): string
return $serviceNameParts[0];
}

private static function needTrackProcess(): bool
protected static function needTrackProcess(): bool
{
return getenv(self::ENV_TRACK_PROCESSES) === 'true';
}

private static function getProcessTrackingDir(): string
protected static function getProcessTrackingDir(): string
{
return self::PROCESS_TRACKING_DIR;
}

private static function getTodayDir(): string
protected static function getTodayDir(): string
{
return (new \DateTime())->format('Y-m-d') . '/';
}
Expand Down
Loading