Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unit testing 使用golang prometheus testutil进行单元测试_Unit Testing_Go_Prometheus - Fatal编程技术网

Unit testing 使用golang prometheus testutil进行单元测试

Unit testing 使用golang prometheus testutil进行单元测试,unit-testing,go,prometheus,Unit Testing,Go,Prometheus,我们可以断言使用testutil.CollectAndCount和testutil.CollectAndCompare等来注册和收集度量。但是如果是CounterVec,是否有办法通过度量名称和标签来收集度量 供参考 您好,不确定我是否完全理解了您的问题:您想测试CounterVec作为文本的输出,还是试图断言值是正确的?您好,不确定我是否完全理解您的问题:您想测试CounterVec作为文本的输出,还是试图断言值是正确的?

我们可以断言使用
testutil.CollectAndCount
testutil.CollectAndCompare
等来注册和收集度量。但是如果是
CounterVec
,是否有办法通过度量名称和标签来收集度量

供参考

您好,不确定我是否完全理解了您的问题:您想测试CounterVec作为文本的输出,还是试图断言值是正确的?您好,不确定我是否完全理解您的问题:您想测试CounterVec作为文本的输出,还是试图断言值是正确的?