1 | <?php |
||
21 | class PrometheusExport { |
||
22 | |||
23 | /** |
||
24 | * Gets the header of a metric like its type or help. |
||
25 | * |
||
26 | * @param $type |
||
27 | * the header type, "HELP" or "TYPE" |
||
28 | * @param $metric |
||
29 | * the metric |
||
30 | * @param $label |
||
31 | * the label of the header like the actual help text or Prometheus type |
||
32 | * |
||
33 | * @return string |
||
34 | * the complete header |
||
35 | */ |
||
36 | protected function getHeader($type, $metric, $label) { |
||
43 | |||
44 | /** |
||
45 | * Gets a metric with header and values. |
||
46 | * |
||
47 | * @param string $metric |
||
48 | * the metric |
||
49 | * @param string $label |
||
50 | * the categorizing label |
||
51 | * @param array $labelsToValues |
||
52 | * each label value mapping to the metric value |
||
53 | * @param string $help |
||
54 | * a helping text about the metric |
||
55 | * @param string $type |
||
56 | * the Prometheus type of the metric |
||
57 | * |
||
58 | * @return string |
||
59 | * the Prometheus export string of this metric |
||
60 | */ |
||
61 | protected function getMetric($metric, $label, array $labelsToValues, $help, $type) { |
||
69 | |||
70 | /** |
||
71 | * Gets a Prometheus export of the given storage. |
||
72 | * |
||
73 | * @param AbstractStorage $storage |
||
74 | * the storage to export |
||
75 | * @param $keys |
||
76 | * the measurement keys to export |
||
77 | * |
||
78 | * @return string |
||
79 | * the Prometheus export string of all available metrics |
||
80 | */ |
||
81 | public function getExport(AbstractStorage $storage, $keys) { |
||
89 | |||
90 | } |
||
91 |