40 ganglia_slope_t slope = GANGLIA_SLOPE_POSITIVE;
44 CPPUNIT_ASSERT(
metric.getUnit() == unit);
46 CPPUNIT_ASSERT(
metric.getMaxDeltaTime() == 15);
47 CPPUNIT_ASSERT(
metric.getLifeTime() == 5);
48 CPPUNIT_ASSERT(
metric.getSlope() == slope);
49 CPPUNIT_ASSERT(
metric.getType() ==
"uint32");
50 CPPUNIT_ASSERT(
metric.getValue() == 0);
51 CPPUNIT_ASSERT(
metric.getSumW() == 0);
52 CPPUNIT_ASSERT(
metric.getNW() == 0);
53 CPPUNIT_ASSERT(
metric.getSumWX() == 0);
54 CPPUNIT_ASSERT(
metric.getSumWXSq() == 0);
55 CPPUNIT_ASSERT(
metric.isValueSet() ==
false);
56 CPPUNIT_ASSERT(
metric.getPartition() == -1);
57 CPPUNIT_ASSERT(
metric.getApplicationName() ==
"");
58 CPPUNIT_ASSERT(
metric.getGroupName() ==
"");
59 CPPUNIT_ASSERT(
metric.getMetricName() ==
metric.getName());
60 uint32_t lastValueSent = 99;
61 CPPUNIT_ASSERT(
metric.getLastValueSent(lastValueSent) ==
false);
62 CPPUNIT_ASSERT(lastValueSent == 99);
69 CPPUNIT_ASSERT(metric2.getName() ==
name);
70 CPPUNIT_ASSERT(metric2.getUnit() == unit);
71 CPPUNIT_ASSERT(metric2.getMetricType() ==
VALUE);
72 CPPUNIT_ASSERT(metric2.getMaxDeltaTime() == 15);
73 CPPUNIT_ASSERT(metric2.getLifeTime() == 5);
74 CPPUNIT_ASSERT(metric2.getSlope() == slope);
75 CPPUNIT_ASSERT(metric2.getType() ==
"uint32");
76 CPPUNIT_ASSERT(metric2.getValue() == 0);
77 CPPUNIT_ASSERT(metric2.getSumW() == 0);
78 CPPUNIT_ASSERT(metric2.getNW() == 0);
79 CPPUNIT_ASSERT(metric2.getSumWX() == 0);
80 CPPUNIT_ASSERT(metric2.getSumWXSq() == 0);
81 CPPUNIT_ASSERT(metric2.isValueSet() ==
false);
82 CPPUNIT_ASSERT(metric2.getPartition() ==
partition);
83 CPPUNIT_ASSERT(metric2.getApplicationName() == appName);
84 CPPUNIT_ASSERT(metric2.getGroupName() == groupName);
85 CPPUNIT_ASSERT(metric2.getMetricName() ==
"dummy_Adcmapp_P2");
99 CPPUNIT_ASSERT(
metric.getType() ==
"uint32");
113 CPPUNIT_ASSERT(
metric.getType() ==
"int32");
127 CPPUNIT_ASSERT(
metric.getType() ==
"uint16");
141 CPPUNIT_ASSERT(
metric.getType() ==
"int16");
155 CPPUNIT_ASSERT(
metric.getType() ==
"uint8");
169 CPPUNIT_ASSERT(
metric.getType() ==
"int8");
184 CPPUNIT_ASSERT(
metric.getType() ==
"float");
199 CPPUNIT_ASSERT(
metric.getType() ==
"double");
213 CPPUNIT_ASSERT(
metric.getType() ==
"Unknown");
228 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
false);
230 CPPUNIT_ASSERT(metricUInt32.setValue(10));
231 CPPUNIT_ASSERT(metricUInt32.getValue() == 10);
232 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
true);
235 CPPUNIT_ASSERT(metricDouble.setValue(15.));
236 CPPUNIT_ASSERT(metricDouble.getValue() == 15.);
237 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
true);
238 CPPUNIT_ASSERT(metricDouble.setValue(-15.));
239 CPPUNIT_ASSERT(metricDouble.getValue() == -15.);
240 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
true);
243 CPPUNIT_ASSERT(metricInt32.setValue(-1));
244 CPPUNIT_ASSERT(metricInt32.getValue() == -1);
245 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
true);
246 CPPUNIT_ASSERT(metricInt32.setValue(15));
247 CPPUNIT_ASSERT(metricInt32.getValue() == 15);
248 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
true);
262 CPPUNIT_ASSERT(metricUInt32.setValue(10));
263 uint32_t sendValueUInt32 = 0;
264 CPPUNIT_ASSERT(metricUInt32._calculateSendValue(sendValueUInt32) ==
true);
265 CPPUNIT_ASSERT(sendValueUInt32 == 10);
269 CPPUNIT_ASSERT(metricDouble.setValue(15.));
270 CPPUNIT_ASSERT(metricDouble.setValue(-15));
271 double sendValueDouble = 0;
272 CPPUNIT_ASSERT(metricDouble._calculateSendValue(sendValueDouble) ==
true);
273 CPPUNIT_ASSERT(sendValueDouble == -15.);
276 CPPUNIT_ASSERT(metricInt32.setValue(-1));
277 CPPUNIT_ASSERT(metricInt32.setValue(15));
278 int32_t sendValueInt32 = 0;
279 CPPUNIT_ASSERT(metricInt32._calculateSendValue(sendValueInt32) ==
true);
280 CPPUNIT_ASSERT(sendValueInt32 == 15);
294 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
false);
296 CPPUNIT_ASSERT(metricUInt32.setValue(10));
297 CPPUNIT_ASSERT(metricUInt32.getValue() == 10);
298 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
true);
299 CPPUNIT_ASSERT(metricUInt32.setValue(10));
300 CPPUNIT_ASSERT(metricUInt32.getValue() == 20);
301 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
true);
305 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
false);
306 CPPUNIT_ASSERT(metricDouble.setValue(15.));
307 CPPUNIT_ASSERT(metricDouble.getValue() == 15.);
308 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
true);
309 CPPUNIT_ASSERT(metricDouble.setValue(-15.));
310 CPPUNIT_ASSERT(metricDouble.getValue() == 0.);
311 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
true);
315 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
false);
316 CPPUNIT_ASSERT(metricInt32.setValue(-1));
317 CPPUNIT_ASSERT(metricInt32.getValue() == -1);
318 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
true);
319 CPPUNIT_ASSERT(metricInt32.setValue(15));
320 CPPUNIT_ASSERT(metricInt32.getValue() == 14);
321 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
true);
331 ::mf::LogInfo(
"unittest") <<
"NdmcMetricTest::testCalculateSendValueMetricTypeCOUNTER." 336 CPPUNIT_ASSERT(metricUInt32.setValue(10));
337 uint32_t sendValueUInt32 = 0;
338 CPPUNIT_ASSERT(metricUInt32._calculateSendValue(sendValueUInt32) ==
true);
339 CPPUNIT_ASSERT(sendValueUInt32 == 10);
343 CPPUNIT_ASSERT(metricDouble.setValue(15.));
344 CPPUNIT_ASSERT(metricDouble.setValue(-15));
345 double sendValueDouble = 0;
346 CPPUNIT_ASSERT(metricDouble._calculateSendValue(sendValueDouble) ==
true);
347 CPPUNIT_ASSERT(sendValueDouble == 0.);
350 CPPUNIT_ASSERT(metricInt32.setValue(-1));
351 CPPUNIT_ASSERT(metricInt32.setValue(15));
352 int32_t sendValueInt32 = 0;
353 CPPUNIT_ASSERT(metricInt32._calculateSendValue(sendValueInt32) ==
true);
354 CPPUNIT_ASSERT(sendValueInt32 == 14);
368 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
false);
370 CPPUNIT_ASSERT(metricUInt32.setValue(10));
371 CPPUNIT_ASSERT(metricUInt32.getValue() == 10);
372 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
true);
373 CPPUNIT_ASSERT(metricUInt32.setValue(10));
374 CPPUNIT_ASSERT(metricUInt32.getValue() == 20);
375 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
true);
379 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
false);
380 CPPUNIT_ASSERT(metricDouble.setValue(15.));
381 CPPUNIT_ASSERT(metricDouble.getValue() == 15.);
382 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
true);
383 CPPUNIT_ASSERT(metricDouble.setValue(-15.));
384 CPPUNIT_ASSERT(metricDouble.getValue() == 0.);
385 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
true);
388 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
false);
389 CPPUNIT_ASSERT(metricInt32.setValue(-1));
390 CPPUNIT_ASSERT(metricInt32.getValue() == -1);
391 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
true);
392 CPPUNIT_ASSERT(metricInt32.setValue(15));
393 CPPUNIT_ASSERT(metricInt32.getValue() == 14);
394 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
true);
404 ::mf::LogInfo(
"unittest") <<
"NdmcMetricTest::testCalculateSendValueMetricTypeRATE." 409 CPPUNIT_ASSERT(metricUInt32.setValue(10));
410 uint32_t sendValueUInt32 = 0;
411 CPPUNIT_ASSERT(metricUInt32._calculateSendValue(sendValueUInt32,9.) ==
true);
412 CPPUNIT_ASSERT(sendValueUInt32 == 1);
413 CPPUNIT_ASSERT(metricUInt32._calculateSendValue(sendValueUInt32,15.) ==
true);
414 CPPUNIT_ASSERT(sendValueUInt32 == 0);
418 CPPUNIT_ASSERT(metricDouble.setValue(15.));
419 CPPUNIT_ASSERT(metricDouble.setValue(-15));
420 double sendValueDouble = 0;
421 CPPUNIT_ASSERT(metricDouble._calculateSendValue(sendValueDouble,10.) ==
true);
422 CPPUNIT_ASSERT(sendValueDouble == 0.);
423 CPPUNIT_ASSERT(metricDouble.setValue(5.));
424 CPPUNIT_ASSERT(metricDouble._calculateSendValue(sendValueDouble,10.) ==
true);
425 CPPUNIT_ASSERT(sendValueDouble == 0.5);
426 CPPUNIT_ASSERT(metricDouble._calculateSendValue(sendValueDouble,0.) ==
false);
429 CPPUNIT_ASSERT(metricInt32.setValue(-1));
430 CPPUNIT_ASSERT(metricInt32.setValue(15));
431 int32_t sendValueInt32 = 0;
432 CPPUNIT_ASSERT(metricInt32._calculateSendValue(sendValueInt32,10) ==
true);
433 CPPUNIT_ASSERT(sendValueInt32 == 1);
447 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
false);
449 CPPUNIT_ASSERT(metricUInt32.setValue(10));
450 CPPUNIT_ASSERT(metricUInt32.getSumWX() == 10);
451 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
true);
452 CPPUNIT_ASSERT(metricUInt32.setValue(10,2.));
453 CPPUNIT_ASSERT(metricUInt32.getSumWX() == 30);
454 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
true);
459 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
false);
460 CPPUNIT_ASSERT(metricDouble.setValue(15.));
461 CPPUNIT_ASSERT(metricDouble.getSumWX() == 15.);
462 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
true);
463 CPPUNIT_ASSERT(metricDouble.setValue(-15.,2.));
464 CPPUNIT_ASSERT(metricDouble.getSumWX() == -15.);
465 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
true);
469 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
false);
470 CPPUNIT_ASSERT(metricInt32.setValue(-1));
471 CPPUNIT_ASSERT(metricInt32.getSumWX() == -1);
472 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
true);
473 CPPUNIT_ASSERT(metricInt32.setValue(15,2));
474 CPPUNIT_ASSERT(metricInt32.getSumWX() == 29);
475 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
true);
485 ::mf::LogInfo(
"unittest") <<
"NdmcMetricTest::testCalculateSendValueMetricTypeAVERAGE." 490 CPPUNIT_ASSERT(metricUInt32.setValue(10));
491 CPPUNIT_ASSERT(metricUInt32.setValue(10,2.));
492 uint32_t sendValueUInt32 = 0;
493 CPPUNIT_ASSERT(metricUInt32._calculateSendValue(sendValueUInt32) ==
true);
494 CPPUNIT_ASSERT(sendValueUInt32 == 10);
498 CPPUNIT_ASSERT(metricDouble.setValue(15.));
499 CPPUNIT_ASSERT(metricDouble.setValue(-15.,2.));
500 double sendValueDouble = 0;
501 CPPUNIT_ASSERT(metricDouble._calculateSendValue(sendValueDouble) ==
true);
502 CPPUNIT_ASSERT(sendValueDouble == -5.);
505 CPPUNIT_ASSERT(metricInt32.setValue(-1));
506 CPPUNIT_ASSERT(metricInt32.setValue(15,2));
507 int32_t sendValueInt32 = 0;
508 CPPUNIT_ASSERT(metricInt32._calculateSendValue(sendValueInt32) ==
true);
509 CPPUNIT_ASSERT(sendValueInt32 == 9);
523 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
false);
525 CPPUNIT_ASSERT(metricUInt32.setValue(10));
526 CPPUNIT_ASSERT(metricUInt32.getValue() == 10);
527 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
true);
528 CPPUNIT_ASSERT(metricUInt32.setValue(10));
529 CPPUNIT_ASSERT(metricUInt32.getValue() == 10);
530 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
true);
535 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
false);
536 CPPUNIT_ASSERT(metricDouble.setValue(15.));
537 CPPUNIT_ASSERT(metricDouble.getValue() == 15.);
538 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
true);
539 CPPUNIT_ASSERT(metricDouble.setValue(-15.));
540 CPPUNIT_ASSERT(metricDouble.getValue() == -15.);
541 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
true);
545 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
false);
546 CPPUNIT_ASSERT(metricInt32.setValue(-1));
547 CPPUNIT_ASSERT(metricInt32.getValue() == -1);
548 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
true);
549 CPPUNIT_ASSERT(metricInt32.setValue(15));
550 CPPUNIT_ASSERT(metricInt32.getValue() == -1);
551 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
true);
561 ::mf::LogInfo(
"unittest") <<
"NdmcMetricTest::testCalculateSendValueMetricTypeMINIMUM." 566 CPPUNIT_ASSERT(metricUInt32.setValue(10));
567 CPPUNIT_ASSERT(metricUInt32.setValue(10));
568 uint32_t sendValueUInt32 = 0;
569 CPPUNIT_ASSERT(metricUInt32._calculateSendValue(sendValueUInt32) ==
true);
570 CPPUNIT_ASSERT(sendValueUInt32 == 10);
574 CPPUNIT_ASSERT(metricDouble.setValue(15.));
575 CPPUNIT_ASSERT(metricDouble.setValue(-15));
576 double sendValueDouble = 0;
577 CPPUNIT_ASSERT(metricDouble._calculateSendValue(sendValueDouble) ==
true);
578 CPPUNIT_ASSERT(sendValueDouble == -15.);
581 CPPUNIT_ASSERT(metricInt32.setValue(-1));
582 CPPUNIT_ASSERT(metricInt32.setValue(15));
583 int32_t sendValueInt32 = 0;
584 CPPUNIT_ASSERT(metricInt32._calculateSendValue(sendValueInt32) ==
true);
585 CPPUNIT_ASSERT(sendValueInt32 == -1);
599 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
false);
601 CPPUNIT_ASSERT(metricUInt32.setValue(10));
602 CPPUNIT_ASSERT(metricUInt32.getValue() == 10);
603 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
true);
604 CPPUNIT_ASSERT(metricUInt32.setValue(10));
605 CPPUNIT_ASSERT(metricUInt32.getValue() == 10);
606 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
true);
611 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
false);
612 CPPUNIT_ASSERT(metricDouble.setValue(15.));
613 CPPUNIT_ASSERT(metricDouble.getValue() == 15.);
614 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
true);
615 CPPUNIT_ASSERT(metricDouble.setValue(-15.));
616 CPPUNIT_ASSERT(metricDouble.getValue() == 15.);
617 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
true);
621 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
false);
622 CPPUNIT_ASSERT(metricInt32.setValue(-1));
623 CPPUNIT_ASSERT(metricInt32.getValue() == -1);
624 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
true);
625 CPPUNIT_ASSERT(metricInt32.setValue(15));
626 CPPUNIT_ASSERT(metricInt32.getValue() == 15);
627 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
true);
637 ::mf::LogInfo(
"unittest") <<
"NdmcMetricTest::testCalculateSendValueMetricTypeMAXIMUM." 642 CPPUNIT_ASSERT(metricUInt32.setValue(10));
643 CPPUNIT_ASSERT(metricUInt32.setValue(10));
644 uint32_t sendValueUInt32 = 0;
645 CPPUNIT_ASSERT(metricUInt32._calculateSendValue(sendValueUInt32) ==
true);
646 CPPUNIT_ASSERT(sendValueUInt32 == 10);
650 CPPUNIT_ASSERT(metricDouble.setValue(15.));
651 CPPUNIT_ASSERT(metricDouble.setValue(-15));
652 double sendValueDouble = 0;
653 CPPUNIT_ASSERT(metricDouble._calculateSendValue(sendValueDouble) ==
true);
654 CPPUNIT_ASSERT(sendValueDouble == 15.);
657 CPPUNIT_ASSERT(metricInt32.setValue(-1));
658 CPPUNIT_ASSERT(metricInt32.setValue(15));
659 int32_t sendValueInt32 = 0;
660 CPPUNIT_ASSERT(metricInt32._calculateSendValue(sendValueInt32) ==
true);
661 CPPUNIT_ASSERT(sendValueInt32 == 15);
675 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
false);
677 CPPUNIT_ASSERT(metricUInt32.setValue(10));
678 CPPUNIT_ASSERT(metricUInt32.getSumWX() == 10);
679 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
true);
680 CPPUNIT_ASSERT(metricUInt32.setValue(10,2.));
681 CPPUNIT_ASSERT(metricUInt32.getSumWX() == 30);
682 CPPUNIT_ASSERT(metricUInt32.isValueSet() ==
true);
687 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
false);
688 CPPUNIT_ASSERT(metricDouble.setValue(15.));
689 CPPUNIT_ASSERT(metricDouble.getSumWX() == 15.);
690 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
true);
691 CPPUNIT_ASSERT(metricDouble.setValue(-15.,2.));
692 CPPUNIT_ASSERT(metricDouble.getSumWX() == -15.);
693 CPPUNIT_ASSERT(metricDouble.isValueSet() ==
true);
697 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
false);
698 CPPUNIT_ASSERT(metricInt32.setValue(-1));
699 CPPUNIT_ASSERT(metricInt32.getSumWX() == -1);
700 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
true);
701 CPPUNIT_ASSERT(metricInt32.setValue(15,2));
702 CPPUNIT_ASSERT(metricInt32.getSumWX() == 29);
703 CPPUNIT_ASSERT(metricInt32.isValueSet() ==
true);
713 ::mf::LogInfo(
"unittest") <<
"NdmcMetricTest::testCalculateSendValueMetricTypeSTDEV." 718 CPPUNIT_ASSERT(metricUInt32.setValue(10));
719 CPPUNIT_ASSERT(metricUInt32.setValue(10,2.));
720 uint32_t sendValueUInt32 = 0;
721 CPPUNIT_ASSERT(metricUInt32._calculateSendValue(sendValueUInt32) ==
true);
722 CPPUNIT_ASSERT(sendValueUInt32 == 0);
726 CPPUNIT_ASSERT(metricDouble.setValue(15.));
727 CPPUNIT_ASSERT(metricDouble.setValue(-15.));
728 double sendValueDouble = 0;
729 CPPUNIT_ASSERT(metricDouble._calculateSendValue(sendValueDouble) ==
true);
730 CPPUNIT_ASSERT(
int(sendValueDouble*1000) == 21213);
733 CPPUNIT_ASSERT(metricInt32.setValue(-1));
734 CPPUNIT_ASSERT(metricInt32.setValue(15));
735 CPPUNIT_ASSERT(metricInt32.setValue(15));
736 int32_t sendValueInt32 = 0;
737 CPPUNIT_ASSERT(metricInt32._calculateSendValue(sendValueInt32) ==
true);
738 CPPUNIT_ASSERT(sendValueInt32 == 9);
749 uint32_t lastValueSent=0;
751 CPPUNIT_ASSERT(metric.
setValue(10));
752 uint32_t sendValue = 0;
754 CPPUNIT_ASSERT(sendValue == 1);
758 CPPUNIT_ASSERT(lastValueSent == sendValue);
761 CPPUNIT_ASSERT(sendValue== 0);
764 CPPUNIT_ASSERT(lastValueSent == sendValue);
773 ::mf::LogInfo(
"unittest") <<
"NdmcMetricTest::testSetPartition." 780 metric.setPartition(partition);
782 CPPUNIT_ASSERT(
metric.getApplicationName() ==
"");
783 CPPUNIT_ASSERT(
metric.getGroupName() ==
"");
784 CPPUNIT_ASSERT(
metric.getMetricName() ==
"dummy_P0");
793 ::mf::LogInfo(
"unittest") <<
"NdmcMetricTest::testSetApplicationName." 800 metric.setApplicationName(appName);
801 CPPUNIT_ASSERT(
metric.getApplicationName() ==
"myapp");
802 CPPUNIT_ASSERT(
metric.getMetricName() ==
"dummy_Amyapp");
803 CPPUNIT_ASSERT(
metric.getPartition() == -1);
804 CPPUNIT_ASSERT(
metric.getGroupName() ==
"");
807 metric.setPartition(partition);
808 CPPUNIT_ASSERT(
metric.getApplicationName() ==
"myapp");
810 CPPUNIT_ASSERT(
metric.getGroupName() ==
"");
811 CPPUNIT_ASSERT(
metric.getMetricName() ==
"dummy_Amyapp_P0");
820 ::mf::LogInfo(
"unittest") <<
"NdmcMetricTest::testSetGroupName." 827 metric.setGroupName(groupName);
828 CPPUNIT_ASSERT(
metric.getApplicationName() ==
"");
829 CPPUNIT_ASSERT(
metric.getMetricName() ==
"dummy");
830 CPPUNIT_ASSERT(
metric.getPartition() == -1);
831 CPPUNIT_ASSERT(
metric.getGroupName() == groupName);
845 CPPUNIT_ASSERT(
metric.getTitle() ==
"");
858 ::mf::LogInfo(
"unittest") <<
"NdmcMetricTest::testSetDescription." 863 CPPUNIT_ASSERT(
metric.getDescription() ==
"");
866 metric.setDescription(description);
CPPUNIT_REGISTRY_ADD_TO_DEFAULT("NovaDAQMonitorClient")
void testCalculateSendValueMetricTypeCOUNTER()
void testGetTypeUint16_t()
void testCalculateSendValueMetricTypeRATE()
void testCalculateSendValueMetricTypeSTDEV()
void testSetValueMetricTypeMINIMUM()
void testGetLastValueSent()
void testSetDescription()
void testSetValueMetricTypeCOUNTER()
void testGetTypeUint8_t()
void testCalculateSendValueMetricTypeMAXIMUM()
void testCalculateSendValueMetricTypeMINIMUM()
void testGetTypeUnknown()
void testSetValueMetricTypeVALUE()
void testCalculateSendValueMetricTypeVALUE()
static void setCONFIGFILE(std::string configfile)
NDMC_NAMESPACE_BEGIN std::string getConfigFullFilePathName(std::string configFile)
void testSetValueMetricTypeSTDEV()
void testSetApplicationName()
bool setValue(T value, double weight=1., int npar=0, double *par=0)
void testSetValueMetricTypeMAXIMUM()
void testGetTypeInt32_t()
void testGetTypeUint32_t()
bool _calculateSendValue(T &sendValue, double timeSinceLastSend=0)
void testSetValueMetricTypeAVERAGE()
void testCalculateSendValueMetricTypeAVERAGE()
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(NdmcMetricTest,"NovaDAQMonitorClient")
bool getLastValueSent(T &lastValueSent) const
void testSetValueMetricTypeRATE()
void testGetTypeInt16_t()