Log Request Count

Source: Internet
Author: User

 Packagetest;ImportJava.io.BufferedReader;ImportJava.io.File;ImportJava.io.FileInputStream;ImportJava.io.InputStreamReader;ImportJava.util.Map;ImportJava.util.TreeMap; Public classCount { Public Static voidMain (string[] args)throwsException {File file=NewFile ("D:/kht_d2.log"); BufferedReader in=NewBufferedReader (NewInputStreamReader (NewFileInputStream (file), "UTF-8")); Map<string, integer> map =read (in);  for(String str:map.keySet ()) {System.out.println (str+ "=" +map.get (str));    } in.close (); }         Public StaticMap<string, integer> read (BufferedReader in)throwsException {Map<string, integer> map =NewTreemap<string, integer>(); String Str=NULL; intCount = 0;  while(str = in.readline ())! =NULL) {            if(Str.length () > && (Str.indexof ("")! =-1) ) {String date= Str.substring (Str.indexof (":") + 1, Str.indexof (":") + 11); if(Map.get (date) = =NULL) {Count= 0; Map.put (date,++count); } Else{map.put (date,++count); }            }        }        returnmap; }    }


This is the number of requests sent from our platform to other platforms, the idea is to verify each line of keywords, if there is 1 operation

Log Request Count

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.