3
3
import time
4
4
import unittest
5
5
6
- import pytest
7
6
import pandas as pd
7
+ import pytest
8
8
9
9
from prometheus_client import (
10
10
CollectorRegistry , CONTENT_TYPE_LATEST , core , Counter , delete_from_gateway ,
@@ -204,9 +204,9 @@ def test_gauge_pandas(self):
204
204
ou
205
205
PandasGauge('report_pandas', 'metric description', df=df, columns=['columnn01', 'column02'], registry=self.registry)
206
206
"""
207
- df = pd .DataFrame ({'a' : [1.1 , 2.2 , 3.3 , 4.4 ], 'b' :[5.1 , 6.2 , 7.3 , 8.4 ], 'value' : [1 , 2 , 3 , 4 ]})
208
- df2 = pd .DataFrame ({'c' : [1.1 , 2.2 , 3.3 , 4.4 ], 'd' :[5.1 , 6.2 , 7.3 , 8.4 ], 'value' : [5 , 6 , 7 , 8 ]})
209
- PandasGauge ('report_pandas' , 'metric description' , df = df , columns = ['a' , 'b' , 'value' ], registry = self .registry )
207
+ df = pd .DataFrame ({'a' : [1.1 , 2.2 , 3.3 , 4.4 ], 'b' : [5.1 , 6.2 , 7.3 , 8.4 ], 'value' : [1 , 2 , 3 , 4 ]})
208
+ df2 = pd .DataFrame ({'c' : [1.1 , 2.2 , 3.3 , 4.4 ], 'd' : [5.1 , 6.2 , 7.3 , 8.4 ], 'value' : [5 , 6 , 7 , 8 ]})
209
+ PandasGauge ('report_pandas' , 'metric description' , df = df , columns = ['a' , 'b' , 'value' ], registry = self .registry )
210
210
g2 = PandasGauge ('report_panda2s' , 'metric description2' , df = df2 , registry = self .registry )
211
211
212
212
self .assertEqual (
@@ -253,10 +253,10 @@ def tes
10000
t_gauge_pandas_columns(self):
253
253
ou
254
254
PandasGauge('report_pandas', 'metric description', df=df, columns=['columnn01', 'column02'], registry=self.registry)
255
255
"""
256
- df = pd .DataFrame ({'a' : [1.1 , 2.2 , 3.3 , 4.4 ], 'b' :[5.1 , 6.2 , 7.3 , 8.4 ], 'value' : [1 , 2 , 3 , 4 ]})
257
- df2 = pd .DataFrame ({'c' : [1.1 , 2.2 , 3.3 , 4.4 ], 'd' :[5.1 , 6.2 , 7.3 , 8.4 ], 'result' : [5 , 6 , 7 , 8 ]})
258
- PandasGauge ('report_pandas' , 'metric description' , df = df , columns = ['a' , 'value' ], registry = self .registry )
259
- g2 = PandasGauge ('report_panda2s' , 'metric description2' , df = df2 , columns = ['d' , 'result' ],value = 'result' ,registry = self .registry )
256
+ df = pd .DataFrame ({'a' : [1.1 , 2.2 , 3.3 , 4.4 ], 'b' : [5.1 , 6.2 , 7.3 , 8.4 ], 'value' : [1 , 2 , 3 , 4 ]})
257
+ df2 = pd .DataFrame ({'c' : [1.1 , 2.2 , 3.3 , 4.4 ], 'd' : [5.1 , 6.2 , 7.3 , 8.4 ], 'result' : [5 , 6 , 7 , 8 ]})
258
+ PandasGauge ('report_pandas' , 'metric description' , df = df , columns = ['a' , 'value' ], registry = self .registry )
259
+ g2 = PandasGauge ('report_panda2s' , 'metric description2' , df = df2 , columns = ['d' , 'result' ],value = 'result' , registry = self .registry )
260
260
261
261
self .assertEqual (
262
262
b'# HELP report_pandas metric description\n '
@@ -274,6 +274,7 @@ def test_gauge_pandas_columns(self):
274
274
generate_latest (self .registry )
275
275
)
276
276
277
+
277
278
class TestPushGateway (unittest .TestCase ):
278
279
def setUp (self ):
279
280
redirect_flag = 'testFlag'
0 commit comments