@@ -67,8 +67,10 @@ def __init__(self):
67
67
68
68
subparser_mongo_input = ComponentSubParser ('mongodb' )
69
69
subparser_mongo_input .add_argument ('u' , 'uri' , help = 'sepcify MongoDB uri' )
70
- subparser_mongo_input .add_argument ('d' , 'db' , help = 'specify MongoDB database name' )
71
- subparser_mongo_input .add_argument ('c' , 'collection' , help = 'specify MongoDB database collection' )
70
+ subparser_mongo_input .add_argument ('d' , 'db' , help = 'specify MongoDB database name' , )
71
+ subparser_mongo_input .add_argument ('c' , 'collection' , help = 'specify MongoDB database collection' ,
72
+ default = 'sensor' )
73
+ subparser_mongo_input .add_argument ('n' , 'name' , help = 'specify puller name' , default = 'puller_mongodb' )
72
74
subparser_mongo_input .add_argument ('m' , 'model' , help = 'specify data type that will be storen in the database' ,
73
75
default = 'hwpc_report' )
74
76
self .add_component_subparser ('input' , subparser_mongo_input ,
@@ -81,15 +83,18 @@ def __init__(self):
81
83
check_msg = 'one or more csv files couldn\' t be read' )
82
84
subparser_csv_input .add_argument ('m' , 'model' , help = 'specify data type that will be storen in the database' ,
83
85
default = 'hwpc_report' )
86
+ subparser_csv_input .add_argument ('n' , 'name' , help = 'specify puller name' , default = 'puller_csv' )
84
87
self .add_component_subparser ('input' , subparser_csv_input ,
85
88
help_str = 'specify a database input : --db_output database_name ARG1 ARG2 ... ' )
86
89
87
90
subparser_mongo_output = ComponentSubParser ('mongodb' )
88
91
subparser_mongo_output .add_argument ('u' , 'uri' , help = 'sepcify MongoDB uri' )
89
92
subparser_mongo_output .add_argument ('d' , 'db' , help = 'specify MongoDB database name' )
90
- subparser_mongo_output .add_argument ('c' , 'collection' , help = 'specify MongoDB database collection' )
93
+ subparser_mongo_output .add_argument ('c' , 'collection' , help = 'specify MongoDB database collection' ,
94
+ default = 'powermeter' )
91
95
subparser_mongo_output .add_argument ('m' , 'model' , help = 'specify data type that will be storen in the database' ,
92
96
default = 'power_report' )
97
+ subparser_mongo_output .add_argument ('n' , 'name' , help = 'specify puller name' , default = 'pusher_mongodb' )
93
98
self .add_component_subparser ('output' , subparser_mongo_output ,
94
99
help_str = 'specify a database output : --db_output database_name ARG1 ARG2 ...' )
95
100
@@ -98,6 +103,7 @@ def __init__(self):
98
103
help = 'specify directory where where output csv files will be writen' )
99
104
subparser_csv_output .add_argument ('m' , 'model' , help = 'specify data type that will be storen in the database' ,
100
105
default = 'power_report' )
106
+ subparser_csv_output .add_argument ('n' , 'name' , help = 'specify puller name' , default = 'pusher_csv' )
101
107
self .add_component_subparser ('output' , subparser_csv_output ,
102
108
help_str = 'specify a database input : --db_output database_name ARG1 ARG2 ... ' )
103
109
@@ -107,6 +113,7 @@ def __init__(self):
107
113
subparser_influx_output .add_argument ('p' , 'port' , help = 'specify InfluxDB connection port' , type = int )
108
114
subparser_influx_output .add_argument ('m' , 'model' , help = 'specify data type that will be storen in the database' ,
109
115
default = 'power_report' )
116
+ subparser_influx_output .add_argument ('n' , 'name' , help = 'specify puller name' , default = 'pusher_influxdb' )
110
117
self .add_component_subparser ('output' , subparser_influx_output ,
111
118
help_str = 'specify a database input : --db_output database_name ARG1 ARG2 ... ' )
112
119
@@ -117,6 +124,7 @@ def __init__(self):
117
124
118
125
subparser_opentsdb_output .add_argument ('m' , 'model' , help = 'specify data type that will be storen in the database' ,
119
126
default = 'power_report' )
127
+ subparser_opentsdb_output .add_argument ('n' , 'name' , help = 'specify puller name' , default = 'pusher_opentsdb' )
120
128
self .add_component_subparser ('output' , subparser_opentsdb_output ,
121
129
help_str = 'specify a database input : --db_output database_name ARG1 ARG2 ... ' )
122
130
@@ -182,7 +190,7 @@ def generate_pullers(config, report_filter):
182
190
try :
183
191
factory = DB_FACTORY [db_config ['type' ]]
184
192
model = MODEL_FACTORY [db_config ['model' ]]
185
- name = 'puller_' + db_config ['type' ]
193
+ name = db_config [name ]
186
194
puller = PullerActor (name , factory (db_config ), report_filter , model , stream_mode = config ['stream' ],
187
195
level_logger = config ['verbose' ])
188
196
pullers [name ] = puller
@@ -210,7 +218,7 @@ def generate_pushers(config):
210
218
try :
211
219
factory = DB_FACTORY [db_config ['type' ]]
212
220
model = MODEL_FACTORY [db_config ['model' ]]
213
- name = 'pusher_' + db_config ['type' ]
221
+ name = db_config [name ]
214
222
pusher = PusherActor (name , model , factory (db_config ), level_logger = config ['verbose' ])
215
223
216
224
pushers [name ] = pusher
0 commit comments