@@ -155,7 +155,7 @@ public function testHostAndPortFromEnvVar()
155155 {
156156 putenv ("DD_AGENT_HOST=myenvvarhost " );
157157 putenv ("DD_DOGSTATSD_PORT=1234 " );
158- $ this ->disableOriginDetectionNonWindows ();
158+ $ this ->disableOriginDetectionLinux ();
159159
160160 $ dog = new DogStatsd ();
161161 $ this ->assertSame (
@@ -174,7 +174,7 @@ public function testHostAndPortFromArgs()
174174 {
175175 putenv ("DD_AGENT_HOST=myenvvarhost " );
176176 putenv ("DD_DOGSTATSD_PORT=1234 " );
177- $ this ->disableOriginDetectionNonWindows ();
177+ $ this ->disableOriginDetectionLinux ();
178178 $ dog = new DogStatsd (array (
179179 'host ' => 'myhost ' ,
180180 'port ' => 4321
@@ -194,7 +194,7 @@ public function testHostAndPortFromArgs()
194194 public function testHostAndPortFromUrl ()
195195 {
196196 putenv ("DD_DOGSTATSD_URL=udp://oh.my.address:1234 " );
197- $ this ->disableOriginDetectionNonWindows ();
197+ $ this ->disableOriginDetectionLinux ();
198198 $ dog = new DogStatsd ();
199199 $ this ->assertSame (
200200 'oh.my.address ' ,
@@ -318,15 +318,15 @@ public function testMicrotiming()
318318 );
319319 }
320320
321- function disableOriginDetectionNonWindows () {
322- if (strtoupper (substr (PHP_OS , 0 , 3 )) ! == 'WIN ' ) {
321+ function disableOriginDetectionLinux () {
322+ if (strtoupper (substr (PHP_OS , 0 , 3 )) == 'LIN ' ) {
323323 putenv ("DD_ORIGIN_DETECTION_ENABLED=false " );
324324 }
325325 }
326326
327327 public function testGauge ()
328328 {
329- $ this ->disableOriginDetectionNonWindows ();
329+ $ this ->disableOriginDetectionLinux ();
330330
331331 $ stat = 'some.gauge_metric ' ;
332332 $ value = 5 ;
@@ -361,7 +361,7 @@ public function testGauge()
361361
362362 public function testGaugeZero ()
363363 {
364- $ this ->disableOriginDetectionNonWindows ();
364+ $ this ->disableOriginDetectionLinux ();
365365
366366 $ stat = 'some.gauge_metric ' ;
367367 $ value = 0 ;
@@ -396,7 +396,7 @@ public function testGaugeZero()
396396
397397 public function testHistogram ()
398398 {
399- $ this ->disableOriginDetectionNonWindows ();
399+ $ this ->disableOriginDetectionLinux ();
400400
401401 $ stat = 'some.histogram_metric ' ;
402402 $ value = 109 ;
@@ -431,7 +431,7 @@ public function testHistogram()
431431
432432 public function testDistribution ()
433433 {
434- $ this ->disableOriginDetectionNonWindows ();
434+ $ this ->disableOriginDetectionLinux ();
435435
436436 $ stat = 'some.distribution_metric ' ;
437437 $ value = 7 ;
@@ -474,7 +474,7 @@ public function testDistribution()
474474 */
475475 public function testSet ($ stat , $ value , $ sampleRate , $ tags , $ expectedUdpMessage )
476476 {
477- $ this ->disableOriginDetectionNonWindows ();
477+ $ this ->disableOriginDetectionLinux ();
478478
479479 $ dog = new DogStatsd (array ("disable_telemetry " => false ));
480480
@@ -547,7 +547,7 @@ public function testServiceCheck(
547547 $ timestamp ,
548548 $ expectedUdpMessage
549549 ) {
550- $ this ->disableOriginDetectionNonWindows ();
550+ $ this ->disableOriginDetectionLinux ();
551551
552552 $ dog = new DogStatsd (array ("disable_telemetry " => false ));
553553
@@ -574,7 +574,7 @@ public function testServiceCheck(
574574
575575 public function serviceCheckProvider ()
576576 {
577- $ this ->disableOriginDetectionNonWindows ();
577+ $ this ->disableOriginDetectionLinux ();
578578
579579 $ name = 'neat-service ' ;
580580 $ status = DogStatsd::CRITICAL ;
@@ -634,7 +634,7 @@ public function serviceCheckProvider()
634634
635635 public function testSend ()
636636 {
637- $ this ->disableOriginDetectionNonWindows ();
637+ $ this ->disableOriginDetectionLinux ();
638638
639639 $ sampleRate = 1.0 ;
640640 $ tags = array (
@@ -676,7 +676,7 @@ public function testSend()
676676
677677 public function testSendSerializesTagAsString ()
678678 {
679- $ this ->disableOriginDetectionNonWindows ();
679+ $ this ->disableOriginDetectionLinux ();
680680
681681 $ data = array (
682682 'foo.metric ' => '82|s ' ,
@@ -701,7 +701,7 @@ public function testSendSerializesTagAsString()
701701
702702 public function testSendSerializesMessageWithoutTags ()
703703 {
704- $ this ->disableOriginDetectionNonWindows ();
704+ $ this ->disableOriginDetectionLinux ();
705705
706706 $ data = array (
707707 'foo.metric ' => '19872|h ' ,
@@ -726,7 +726,7 @@ public function testSendSerializesMessageWithoutTags()
726726
727727 public function testSendReturnsEarlyWhenPassedEmptyData ()
728728 {
729- $ this ->disableOriginDetectionNonWindows ();
729+ $ this ->disableOriginDetectionLinux ();
730730
731731 $ dog = new DogStatsd (array ("disable_telemetry " => false ));
732732
@@ -743,7 +743,7 @@ public function testSendReturnsEarlyWhenPassedEmptyData()
743743
744744 public function testSendSendsWhenRandCalculationLessThanSampleRate ()
745745 {
746- $ this ->disableOriginDetectionNonWindows ();
746+ $ this ->disableOriginDetectionLinux ();
747747
748748 global $ mt_rand_stub_return_value ;
749749 global $ mt_getrandmax_stub_return_value ;
@@ -772,7 +772,7 @@ public function testSendSendsWhenRandCalculationLessThanSampleRate()
772772
773773 public function testSendSendsWhenRandCalculationEqualToSampleRate ()
774774 {
775- $ this ->disableOriginDetectionNonWindows ();
775+ $ this ->disableOriginDetectionLinux ();
776776
777777 global $ mt_rand_stub_return_value ;
778778 global $ mt_getrandmax_stub_return_value ;
@@ -801,7 +801,7 @@ public function testSendSendsWhenRandCalculationEqualToSampleRate()
801801
802802 public function testSendDoesNotSendWhenRandCalculationGreaterThanSampleRate ()
803803 {
804- $ this ->disableOriginDetectionNonWindows ();
804+ $ this ->disableOriginDetectionLinux ();
805805
806806 global $ mt_rand_stub_return_value ;
807807 global $ mt_getrandmax_stub_return_value ;
@@ -830,7 +830,7 @@ public function testSendDoesNotSendWhenRandCalculationGreaterThanSampleRate()
830830
831831 public function testIncrement ()
832832 {
833- $ this ->disableOriginDetectionNonWindows ();
833+ $ this ->disableOriginDetectionLinux ();
834834
835835 $ stats = array (
836836 'foo.metric ' ,
@@ -861,7 +861,7 @@ public function testIncrement()
861861
862862 public function testDecrement ()
863863 {
864- $ this ->disableOriginDetectionNonWindows ();
864+ $ this ->disableOriginDetectionLinux ();
865865
866866 $ stats = array (
867867 'foo.metric ' ,
@@ -892,7 +892,7 @@ public function testDecrement()
892892
893893 public function testDecrementWithValueGreaterThanOne ()
894894 {
895- $ this ->disableOriginDetectionNonWindows ();
895+ $ this ->disableOriginDetectionLinux ();
896896
897897 $ stats = array (
898898 'foo.metric ' ,
@@ -923,7 +923,7 @@ public function testDecrementWithValueGreaterThanOne()
923923
924924 public function testDecrementWithValueLessThanOne ()
925925 {
926- $ this ->disableOriginDetectionNonWindows ();
926+ $ this ->disableOriginDetectionLinux ();
927927
928928 $ stats = array (
929929 'foo.metric ' ,
@@ -954,7 +954,7 @@ public function testDecrementWithValueLessThanOne()
954954
955955 public function testUpdateStats ()
956956 {
957- $ this ->disableOriginDetectionNonWindows ();
957+ $ this ->disableOriginDetectionLinux ();
958958
959959 $ stats = array (
960960 'foo.metric ' ,
@@ -1005,7 +1005,7 @@ public function testUpdateStats()
10051005
10061006 public function testUpdateStatsWithStringMetric ()
10071007 {
1008- $ this ->disableOriginDetectionNonWindows ();
1008+ $ this ->disableOriginDetectionLinux ();
10091009
10101010 $ stats = 'foo.metric ' ;
10111011 $ delta = -45 ;
@@ -1062,7 +1062,7 @@ public function testReport()
10621062
10631063 public function testFlushUdp ()
10641064 {
1065- $ this ->disableOriginDetectionNonWindows ();
1065+ $ this ->disableOriginDetectionLinux ();
10661066
10671067 $ expectedUdpMessage = 'foo ' ;
10681068
@@ -1132,7 +1132,7 @@ public function testFlushUdp()
11321132
11331133 public function testFlushUds ()
11341134 {
1135- $ this ->disableOriginDetectionNonWindows ();
1135+ $ this ->disableOriginDetectionLinux ();
11361136
11371137 $ expectedUdsMessage = 'foo ' ;
11381138 $ expectedUdsSocketPath = '/path/to/some.socket ' ;
@@ -1203,7 +1203,7 @@ public function testFlushUds()
12031203
12041204 public function testEventUdp ()
12051205 {
1206- $ this ->disableOriginDetectionNonWindows ();
1206+ $ this ->disableOriginDetectionLinux ();
12071207
12081208 $ eventTitle = 'Some event title ' ;
12091209 $ eventVals = array (
@@ -1251,7 +1251,7 @@ public function testEventUdp()
12511251 */
12521252 public function testEventUdpWithEmptyValues ()
12531253 {
1254- $ this ->disableOriginDetectionNonWindows ();
1254+ $ this ->disableOriginDetectionLinux ();
12551255
12561256 $ eventTitle = '' ;
12571257
@@ -1281,7 +1281,7 @@ public function testEventUdpWithEmptyValues()
12811281
12821282 public function testGlobalTags ()
12831283 {
1284- $ this ->disableOriginDetectionNonWindows ();
1284+ $ this ->disableOriginDetectionLinux ();
12851285
12861286 $ dog = new DogStatsd (array (
12871287 'global_tags ' => array (
@@ -1309,7 +1309,7 @@ public function testGlobalTags()
13091309
13101310 public function testGlobalTagsWithEntityIdFromEnvVar ()
13111311 {
1312- $ this ->disableOriginDetectionNonWindows ();
1312+ $ this ->disableOriginDetectionLinux ();
13131313
13141314 putenv ("DD_ENTITY_ID=04652bb7-19b7-11e9-9cc6-42010a9c016d " );
13151315 $ dog = new DogStatsd (array (
@@ -1338,7 +1338,7 @@ public function testGlobalTagsWithEntityIdFromEnvVar()
13381338
13391339 public function testGlobalTagsAreSupplementedWithLocalTags ()
13401340 {
1341- $ this ->disableOriginDetectionNonWindows ();
1341+ $ this ->disableOriginDetectionLinux ();
13421342
13431343 $ dog = new DogStatsd (array (
13441344 'global_tags ' => array (
@@ -1367,7 +1367,7 @@ public function testGlobalTagsAreSupplementedWithLocalTags()
13671367
13681368 public function testGlobalTagsAreReplacedWithConflictingLocalTags ()
13691369 {
1370- $ this ->disableOriginDetectionNonWindows ();
1370+ $ this ->disableOriginDetectionLinux ();
13711371
13721372 $ dog = new DogStatsd (array (
13731373 'global_tags ' => array (
@@ -1396,7 +1396,7 @@ public function testGlobalTagsAreReplacedWithConflictingLocalTags()
13961396
13971397 public function testTelemetryDefault ()
13981398 {
1399- $ this ->disableOriginDetectionNonWindows ();
1399+ $ this ->disableOriginDetectionLinux ();
14001400
14011401 $ dog = new DogStatsd ();
14021402 $ dog ->gauge ('metric ' , 42 );
@@ -1409,7 +1409,7 @@ public function testTelemetryDefault()
14091409
14101410 public function testTelemetryEnable ()
14111411 {
1412- $ this ->disableOriginDetectionNonWindows ();
1412+ $ this ->disableOriginDetectionLinux ();
14131413
14141414 $ dog = new DogStatsd (array ("disable_telemetry " => false ));
14151415 $ dog ->gauge ('metric ' , 42 );
@@ -1422,7 +1422,7 @@ public function testTelemetryEnable()
14221422
14231423 public function testTelemetryAllDataType ()
14241424 {
1425- $ this ->disableOriginDetectionNonWindows ();
1425+ $ this ->disableOriginDetectionLinux ();
14261426
14271427 $ dog = new DogStatsd (array ("disable_telemetry " => false ));
14281428
@@ -1460,7 +1460,7 @@ public function testTelemetryAllDataType()
14601460
14611461 public function testTelemetryNetworkError ()
14621462 {
1463- $ this ->disableOriginDetectionNonWindows ();
1463+ $ this ->disableOriginDetectionLinux ();
14641464
14651465 $ dog = new DogStatsd (array ("disable_telemetry " => false ));
14661466 $ this ->getSocketSpy ()->returnErrorOnSend = true ;
@@ -1480,7 +1480,7 @@ public function testTelemetryNetworkError()
14801480
14811481 public function testDecimalNormalization ()
14821482 {
1483- $ this ->disableOriginDetectionNonWindows ();
1483+ $ this ->disableOriginDetectionLinux ();
14841484
14851485 $ dog = new DogStatsd (array ("disable_telemetry " => false , "decimal_precision " => 5 ));
14861486
@@ -1496,7 +1496,7 @@ public function testDecimalNormalization()
14961496
14971497 public function testFloatLocalization ()
14981498 {
1499- $ this ->disableOriginDetectionNonWindows ();
1499+ $ this ->disableOriginDetectionLinux ();
15001500
15011501 $ defaultLocale = setlocale (LC_ALL , 0 );
15021502 setlocale (LC_ALL , 'nl_NL ' );
@@ -1509,7 +1509,7 @@ public function testFloatLocalization()
15091509
15101510 public function testSampleRateFloatLocalization ()
15111511 {
1512- $ this ->disableOriginDetectionNonWindows ();
1512+ $ this ->disableOriginDetectionLinux ();
15131513
15141514 $ defaultLocale = setlocale (LC_ALL , 0 );
15151515 setlocale (LC_ALL , 'de_DE ' );
@@ -1528,7 +1528,7 @@ public function testSampleRateFloatLocalization()
15281528
15291529 public function testMetricPrefix ()
15301530 {
1531- $ this ->disableOriginDetectionNonWindows ();
1531+ $ this ->disableOriginDetectionLinux ();
15321532
15331533 $ dog = new DogStatsd (array ("disable_telemetry " => false , "metric_prefix " => 'test_prefix ' ));
15341534
@@ -1545,7 +1545,7 @@ public function testMetricPrefix()
15451545 public function testExternalEnv ()
15461546 {
15471547 putenv ("DD_EXTERNAL_ENV=cn-SomeKindOfContainerName " );
1548- $ this ->disableOriginDetectionNonWindows ();
1548+ $ this ->disableOriginDetectionLinux ();
15491549
15501550 $ dog = new DogStatsd (array ("disable_telemetry " => false ));
15511551 $ dog ->gauge ('metric ' , 42 );
@@ -1569,7 +1569,7 @@ public function testExternalEnvInvalidCharacters()
15691569 {
15701570 // Environment var contains a new line and a | character..
15711571 putenv ("DD_EXTERNAL_ENV=it-false, \ncn-nginx-webserver,|pu-75a2b6d5-3949-4afb-ad0d-92ff0674e759 " );
1572- $ this ->disableOriginDetectionNonWindows ();
1572+ $ this ->disableOriginDetectionLinux ();
15731573
15741574 $ dog = new DogStatsd (array ("disable_telemetry " => false ));
15751575 $ dog ->gauge ('metric ' , 42 , 1.0 , array ('my_tag ' => 'other_value ' ));
@@ -1591,7 +1591,7 @@ public function testExternalEnvInvalidCharacters()
15911591
15921592 public function testExternalEnvWithTags ()
15931593 {
1594- $ this ->disableOriginDetectionNonWindows ();
1594+ $ this ->disableOriginDetectionLinux ();
15951595
15961596 putenv ("DD_EXTERNAL_ENV=it-false,cn-nginx-webserver,pu-75a2b6d5-3949-4afb-ad0d-92ff0674e759 " );
15971597 $ dog = new DogStatsd (array ("disable_telemetry " => false ));
@@ -1617,7 +1617,7 @@ public function testDDTags()
16171617 putenv ("DD_VERSION=1.2.3 " );
16181618 putenv ("DD_ENV=prod " );
16191619 putenv ("DD_SERVICE=myService " );
1620- $ this ->disableOriginDetectionNonWindows ();
1620+ $ this ->disableOriginDetectionLinux ();
16211621 $ dog = new DogStatsd (array (
16221622 'global_tags ' => array (
16231623 'my_tag ' => 'tag_value ' ,
0 commit comments