mysql数据在时间平均分布_统计时间分布脚本(mysql)详解

这篇博客详细解析了如何使用MySQL查询超时记录、导出日志信息,并提供了统计超时率、时间分布(包括9-17点各时段和每周各天)的脚本。内容涉及访问记录筛选、时间条件判断以及数据聚合分析。
摘要由CSDN通过智能技术生成

mysql

-- 查询超时记录

select * from visit_record t where t.accesstime>to_date('2013-09-1','yyyy-MM-dd') and t.username is not null and t.result='成功' and t.totaltimecost>5000 and t.clientip <> '192.168.112.53' and t.clientip <> '192.168.112.200' and t.clientip <> '192.168.112.245' order by t.totaltimecost desc ;

-- 导出日期范围内的日志信息(已xml格式导出为stat.xml,使用navicat工具导入进stat表)

select t.username,t.accesstime,t.totaltimecost,t.accessurl from visit_record t where t.accesstime>to_date('2013-09-1','yyyy-MM-dd') and t.username is not null and t.result='成功' and t.clientip <> '192.168.112.53' and t.clientip <> '192.168.112.200' and t.clientip <> '192.168.112.245'

and (t.accessurl='/newOA/m_flow/navPage.do' or

t.accessurl='/newOA/m_commWorkflow/submitN

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值