diff options
| author | 杨威 <[email protected]> | 2020-04-07 14:41:02 +0800 |
|---|---|---|
| committer | 杨威 <[email protected]> | 2020-04-07 14:41:02 +0800 |
| commit | 9c9b8a993bb774d2c11e44799276cb6369b03e3a (patch) | |
| tree | 6da583f15448609f758f4d878cd6d234e0d51b03 /src/MESA_field_stat.cpp | |
| parent | 0fef0613c59a211caab513e0ad86f967eb15b2fc (diff) | |
1、influx line protocol输出时,根据column类型输出metric
Diffstat (limited to 'src/MESA_field_stat.cpp')
| -rw-r--r-- | src/MESA_field_stat.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/MESA_field_stat.cpp b/src/MESA_field_stat.cpp index 778b5f6..49c5bde 100644 --- a/src/MESA_field_stat.cpp +++ b/src/MESA_field_stat.cpp @@ -984,7 +984,7 @@ void influx_output(struct FS_space_t* _handle) switch(p->style) { case FS_STYLE_STATUS: - if(p->calc_type==FS_CALC_SPEED) + if (p->calc_type == FS_CALC_CURRENT) { value=get_stat_unit_val(p, 0, FS_CALC_CURRENT, 1); if(value != 0) @@ -1011,7 +1011,14 @@ void influx_output(struct FS_space_t* _handle) { continue; } - value=get_stat_unit_val(p, p_column->column_seq, FS_CALC_SPEED, 1); + if(p_column->calc_type==FS_CALC_SPEED) + { + value = get_stat_unit_val(p, p_column->column_seq, FS_CALC_SPEED, 1); + } + if(p_column->calc_type==FS_CALC_CURRENT) + { + value = get_stat_unit_val(p, p_column->column_seq, FS_CALC_CURRENT, 1); + } buff_off+=snprintf(field_buff+buff_off, UDP_PAYLOAD_SIZE-buff_off,"%s=%lld,",p_column->name, value); if(value != 0) { |
