-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c087384
commit d562525
Showing
3 changed files
with
34 additions
and
3 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from cubestat.metrics.base_metric import base_metric | ||
from cubestat.metrics.registry import cubestat_metric | ||
|
||
@cubestat_metric('darwin') | ||
class mock_metric(base_metric): | ||
def read(self, context): | ||
res = {'mock': self.v} | ||
self.v += 1.0 | ||
return res | ||
|
||
def pre(self, title): | ||
return False, '' | ||
|
||
def format(self, title, values, idxs): | ||
return 100.0, [f'{values[i]:3.0f}%' for i in idxs] | ||
|
||
@classmethod | ||
def key(cls): | ||
return 'mock' | ||
|
||
def hotkey(self): | ||
return 'w' | ||
|
||
@classmethod | ||
def configure_argparse(cls, parser): | ||
pass | ||
|
||
def configure(self, conf): | ||
self.v = 0.0 | ||
return self | ||
|