#NEWLINE# def test_put_value_with_meta_info( self ) : #NEWLINE# #INDENT# throughput = 5000 #NEWLINE# self . cfg . add ( config . Scope . application , 'system' , 'user.tag' , 'intention:testing' ) #NEWLINE# self . metrics_store . open ( MetricsTests . TRIAL_TIMESTAMP , 'test' , 'defaults' , create = True ) #NEWLINE# self . metrics_store . add_meta_info ( metrics . MetaInfoScope . cluster , None , 'source_revision' , 'abc123' ) #NEWLINE# self . metrics_store . add_meta_info ( metrics . MetaInfoScope . node , 'node0' , 'os_name' , 'Darwin' ) #NEWLINE# self . metrics_store . add_meta_info ( metrics . MetaInfoScope . node , 'node0' , 'os_version' , '15.4.0' ) #NEWLINE# self . metrics_store . add_meta_info ( metrics . MetaInfoScope . node , 'node1' , 'os_name' , 'Linux' ) #NEWLINE# self . metrics_store . add_meta_info ( metrics . MetaInfoScope . node , 'node1' , 'os_version' , '4.2.0-18-generic' ) #NEWLINE# self . metrics_store . put_value_node_level ( 'node0' , 'indexing_throughput' , throughput , 'docs/s' ) #NEWLINE# expected_doc = { #NEWLINE# #INDENT# '@timestamp' : ( StaticClock . NOW * 1000 ) , #NEWLINE# 'trial-timestamp' : '20160131T000000Z' , #NEWLINE# 'relative-time' : 0 , #NEWLINE# 'environment' : 'unittest' , #NEWLINE# 'sample-type' : 'normal' , #NEWLINE# 'track' : 'test' , #NEWLINE# 'track-setup' : 'defaults' , #NEWLINE# 'name' : 'indexing_throughput' , #NEWLINE# 'value' : throughput , #NEWLINE# 'unit' : 'docs/s' , #NEWLINE# 'meta' : { #NEWLINE# #INDENT# 'tag_intention' : 'testing' , #NEWLINE# 'source_revision' : 'abc123' , #NEWLINE# 'os_name' : 'Darwin' , #NEWLINE# 'os_version' : '15.4.0' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# self . metrics_store . close ( ) #NEWLINE# self . es_mock . exists . assert_called_with ( index = 'rally-2016' ) #NEWLINE# self . es_mock . create_index . assert_called_with ( index = 'rally-2016' ) #NEWLINE# self . es_mock . bulk_index . assert_called_with ( index = 'rally-2016' , doc_type = 'metrics' , items = [ expected_doc ] )