动态 版块 发帖 消息 我的
小绿叶技术博客
小绿叶技术博客
小绿叶技术Lv154   
筛选日志 分析正确率     


#!/bin/bash

cishu=30
lable=3



set_config_log(){
   jieguofile=tongji-$i

   tongjifile="tongji.txt"

   charulog=("`n="0x1" ; cat $i | grep "nEventType" |grep -v JT | awk -v awknr="$n" '$NF==awknr' | awk -F"," '{print $4 "," $5}' |uniq -c | sort -n`")
   charu=(` n="0x1" ; cat $i | grep "nEventType" |grep -v JT | awk -v awknr="$n" '$NF==awknr' | awk -F"," '{print $4 "," $5}' |uniq -c | sort -n  | awk -F" " '{print $1}' `)
   charu=`echo ${charu[*]} | sed "s/ /+/g"` ; charu=$[charu]
   charulv=`echo "" | awk -v charu="$charu" -v cishu="$cishu" '{printf "%0.2f",charu/cishu*100}'` ;  charulv=${charulv:0:4} 

   lablelist=$(n="0x1" ; cat $i | grep "nEventType" |grep -v JT | grep "labelNum = $lable" | awk -v awknr="$n" '$NF==awknr' | awk -F"," '{print $4 "," $5}' |uniq -c | sort -n)
   lablegs=$(echo $lablelist | awk -F" " '{print $1}') ; lablegs=`echo "" | awk -v lablegs="$lablegs" -v cishu="$cishu" '{printf "%0.2f",lablegs/cishu*100}'` ; lablegs=${lablegs:0:4}

   bachulog=("`n="0x2" ; cat $i | grep "nEventType" |grep -v JT | awk -v awknr="$n" '$NF==awknr' | awk -F"," '{print $4 "," $5}' |uniq -c | sort -n`")
   bachu=(` n="0x2" ; cat $i | grep "nEventType" |grep -v JT | awk -v awknr="$n" '$NF==awknr' | awk -F"," '{print $4 "," $5}' |uniq -c | sort -n  | awk -F" " '{print $1}' `)
   bachu=`echo ${bachu[*]} | sed "s/ /+/g"` ; bachu=$[bachu]

   bachulv=`echo "" | awk -v bachu="$bachu" -v cishu="$cishu"  '{printf "%0.2f",bachu/cishu*100}' ` ; bachulv=${bachulv:0:4} 



   echo "#-------------- $i  ---------------# " >> $tongjifile

   echo "  测试次数:$cishu   识别插入次数: $charu    识别插入正确率: $charulv %     识别拔出次数: $bachu    识别拔出识别率:$bachulv %  贴标签个数: $lable   正确识别标签率:$lablegs %  " >> $jieguofile
   echo "  测试次数:$cishu   识别插入次数: $charu    识别插入正确率: $charulv %     识别拔出次数: $bachu    识别拔出识别率:$bachulv %  贴标签个数: $lable   正确识别标签率:$lablegs %  " >> $tongjifile
   echo " "  >> $tongjifile
 
 
   echo "
   #----------- 识别插入日志 -------------#
   ${charulog[*]}

   #----------- 识别拔出日志 ------------#
   ${bachulog[*]}

   #----------  识别标签正确日志 ------------#
   $lablelist

   " >> $jieguofile
 }
 
 runset(){
   file=(`ls | grep log | grep -v tongji`)
   
   for i in ${file[*]}
   do
      set_config_log 
   done
 }
 runset
 
 
 





 8  已被阅读了1134次  楼主 2022-12-19 13:01:30
回复列表

回复:筛选日志 分析正确率

guest
登录之后更精彩~
Powered by HadSky 7.12.10
© 2015-2024 PuYueTian
您的IP:44.221.66.130,2024-06-20 13:43:01,Processed in 0.01982 second(s).
Powered by HadSky
小绿叶技术博客