<s> """<STR_LIT>""" <EOL> from gevent import monkey <EOL> monkey . patch_all ( ) <EOL> import os <EOL> import time <EOL> import unittest <EOL> from dogapi import DogStatsApi <EOL> API_KEY = os . environ . get ( '<STR_LIT>' ) <EOL> class TestGreenletIntegrationDogStatsApi ( unittest . TestCase ) : <EOL> def test_flushing_in_thread ( self ) : <EOL> dog = DogStatsApi ( ) <EOL> dog . start ( roll_up_interval = <NUM_LIT:1> , <EOL> flush_interval = <NUM_LIT:1> , <EOL> flush_in_greenlet = True , <EOL> api_key = API_KEY ) <EOL> now = time . time ( ) <EOL> dog . gauge ( '<STR_LIT>' % now , <NUM_LIT:3> ) <EOL> dog . increment ( '<STR_LIT>' % now ) <EOL> dog . increment ( '<STR_LIT>' % now ) <EOL> dog . histogram ( '<STR_LIT>' % now , <NUM_LIT:20> ) <EOL> dog . histogram ( '<STR_LIT>' % now , <NUM_LIT:30> ) <EOL> time . sleep ( <NUM_LIT:3> ) <EOL> assert <NUM_LIT:1> <= dog . flush_count <= <NUM_LIT:5> <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
