From 2d83bc6b2441cbc653d319389f64932c19c424a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=AC=E5=B7=8D=E5=B7=9D?= Date: Thu, 28 May 2020 14:14:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8E=A8=E8=8D=90=E3=80=81?= =?UTF-8?q?=E8=B6=8B=E5=8A=BF=E3=80=81=E6=97=B6=E9=97=B4=E5=92=8C=E8=AE=A1?= =?UTF-8?q?=E6=95=B0=E5=85=B3=E9=94=AE=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 02-Keyword/tsg_bfapi/LogStatistics.robot | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/02-Keyword/tsg_bfapi/LogStatistics.robot b/02-Keyword/tsg_bfapi/LogStatistics.robot index ac5aee4..9bc0106 100644 --- a/02-Keyword/tsg_bfapi/LogStatistics.robot +++ b/02-Keyword/tsg_bfapi/LogStatistics.robot @@ -232,3 +232,35 @@ SplicingTrafficSql ${where}= Get Substring ${strippedwhere} \ -1 ${sql2} catenate select DATE_FORMAT(FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(__time)/${timeGranularity})*${timeGranularity}),'%Y-%m-%d %H:%i:%s') as statisticsTime, ${where} from traffic_metrics_log where __time >= '${startTime}' and __time < '${endTime}' group by DATE_FORMAT(FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(__time)/${timeGranularity})*${timeGranularity}),'%Y-%m-%d %H:%i:%s') limit ${limit} [Return] ${sql2} +Recommend + [Arguments] ${url} ${statisticTime} + ${header} Create Dictionary Content-Type=application/x-www-form-urlencoded Authorization=${token} + Create Session api http://${host}:${port}/${version} headers=${header} + ${remoteResponse} Get Request api ${url}?statisticTime=${statisticTime} headers=${header} + ${response} to json ${remoteResponse.content} + Should Be Equal As Strings ${remoteResponse.status_code} 200 + +Trend + [Arguments] ${url} ${startTime} ${endTime} ${logType} ${policyId} + ${header} Create Dictionary Content-Type=application/x-www-form-urlencoded Authorization=${token} + Create Session api http://${host}:${port}/${version} headers=${header} + ${remoteResponse} Get Request api ${url}?policyId=${policyId}&logType=${logType}&startTime=${startTime}&endTime=${endTime} headers=${header} + ${response} to json ${remoteResponse.content} + Should Be Equal As Strings ${remoteResponse.status_code} 200 + Should Be Equal As Strings ${remoteResponse.json()}[msg] Success + +Timeandcount + [Arguments] ${url} ${logType} ${policyIds} + ${header} Create Dictionary Content-Type=application/x-www-form-urlencoded Authorization=${token} + Create Session api http://${host}:${port}/${version} headers=${header} + ${remoteResponse} Get Request api ${url}?policyIds=${policyIds}&logType=${logType} headers=${header} + ${response} to json ${remoteResponse.content} + Should Be Equal As Strings ${remoteResponse.status_code} 200 + Should Be Equal As Strings ${remoteResponse.json()}[msg] Success + ${data} set variable ${response}[data][list] + FOR ${kk} ${vv} IN ENUMERATE @{data} + log ${vv}[policyId] + ${true} Evaluate "${vv}[policyId]" in "${policyIds}" + Should Be Equal As Strings ${true} True + END +