Skip to content

Latest commit

 

History

History
76 lines (58 loc) · 2.04 KB

metrics_parser.org

File metadata and controls

76 lines (58 loc) · 2.04 KB

METRIC PARSER

finding metrics for particular ESME

echo "Time,${METRIC_TYPE1},${METRIC_TYPE2}"
for FILE in $(dir); do

    TIMEF=$(echo "${FILE}" | sed 's/\([0-9]\{4\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)_\([0-9]\{2\}\)\([0-9]\{2\}\)\(.*\)/\4:\5 \3-\2-\1/')

    MATCH1=$(grep -i ${ESME} ${FILE} |grep -i Counter |grep -i ApplicationAccessGroup |grep -i ${METRIC_TYPE1})
    MATCH1=$(echo ${MATCH1} | sed 's/;$//' | cut -d"," -f7)
    MATCH2=$(grep -i ${ESME} ${FILE} |grep -i Counter |grep -i ApplicationAccessGroup |grep -i ${METRIC_TYPE2})
    MATCH2=$(echo ${MATCH2} | sed 's/;$//' | cut -d"," -f7)
    echo "${TIMEF},${MATCH1},${MATCH2}"
done
import plotly.offline as py
import plotly.graph_objs as go
#import plotly.figure_factory as FF
from plotly.tools import FigureFactory as FF
import pandas as pd


df = pd.read_csv('/tmp/metric_parser_out.csv', delimiter=',')
df.head()
print(df)

metric1 = go.Scatter(
        x=df['Time'],
        y=df[METRIC_TYPE1],
        mode='lines', name=METRIC_TYPE1
    )

metric2 = go.Scatter(
        x=df['Time'],
        y=df[METRIC_TYPE2],
        mode='lines', name=METRIC_TYPE2
    )

layout = go.Layout(
    title='AAG/XAG metrics plot',
    yaxis=dict(title='count'),
    xaxis=dict(title='Time')
    )

fig = go.Figure(data=[metric1, metric2], layout=layout)

url = py.plot(fig, filename='/tmp/pandas_plot')

gnuplot example

reset
set title "submit request rx : TIMOING"
set xlabel "Time"
set ylabel "MSG Count"
#set xdata time
#set timefmt "%H:%M %d-%m-%Y"
set xtics rotate
set terminal png size 1600,1000
plot data using 2:xtic(1) with lines, '' using 1 with lines