-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Ajat|Baskara] add MetricCollector interface and StatsdCollector
- Loading branch information
1 parent
a3776c7
commit eb59f38
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package metrics | ||
|
||
import "time" | ||
|
||
type MetricResult struct { | ||
ProcessingDuration time.Duration | ||
DownloadDuration time.Duration | ||
TotalDuration time.Duration | ||
ReadDuration time.Duration | ||
WriteDuration time.Duration | ||
CropDuration time.Duration | ||
ResizeDuration time.Duration | ||
MonoDuration time.Duration | ||
} | ||
|
||
// MetricCollector represents the contract that all collectors must fulfill to gather statistics. | ||
// Implementations of this interface do not have to maintain locking around their data stores so long as | ||
// they are not modified outside of the storage/processor context. | ||
type MetricCollector interface { | ||
// Update accepts a set of metrics from a command execution for remote instrumentation | ||
Update(MetricResult) | ||
// Reset resets the internal counters and timers. | ||
Reset() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters