Code Monkey home page Code Monkey logo

avg-per-marker's Introduction

avg-per-marker

Read stdin for [elapsed-time marker] pairs, and print out stats about the elapsed times every time the marker changes.

Here's some sample input:

0.161192 Mon-Mar-24-15:39
0.056217 Mon-Mar-24-15:39
0.160669 Mon-Mar-24-15:40
0.533983 Mon-Mar-24-15:40

cat sample-input.txt into this program to see sample output:

$ cat sample-input.txt | lein run
Mon-Mar-24-15:39 {:count 727, :total-elapsed-time 235.48438481986523, :average-elapsed-time 0.3239124963134322}
Mon-Mar-24-15:40 {:count 1644, :total-elapsed-time 473.59876988083124, :average-elapsed-time 0.28807711063310903}

Examples

$ tail -f /some/log/file | sed <substitute some stuff to create necessary "n marker" format> | java -jar avg-per-min-0.1.0-standalone.jar

Bugs

  • Always throws away any old out-of-order markers after the change to a new marker.

License

Copyright © 2014 VLACS

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

avg-per-marker's People

Contributors

moquist avatar

Watchers

 avatar Valerie Zaharee avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.