Giter Club home page Giter Club logo

Comments (14)

rcoh avatar rcoh commented on May 29, 2024

from angle-grinder.

rcoh avatar rcoh commented on May 29, 2024

from angle-grinder.

tallpsmith avatar tallpsmith commented on May 29, 2024

I was running:

cat loggers.txt| agrind '* | parse "*" as logger | count by logger' > foo

where loggers.txt just contained a simple string.

I first ran the bash command without the > foo to time it. It took 80 seconds and output as expected.

I then ran it with the redirect, waited more than 2 minutes and then CTRL-C'd the process. but foo is empty still.

$ agrind --version
ag 0.7.2

(brew installed).

Example file:

$ head loggers.txt
[OrbStatisticsControl
[it.timing.LoggerSink
[essFaxDeliveryAction
[it.timing.LoggerSink
[it.timing.LoggerSink
[main.TasksRepository
[it.timing.LoggerSink
[it.timing.LoggerSink
[it.timing.LoggerSink
[it.timing.LoggerSink

from angle-grinder.

rcoh avatar rcoh commented on May 29, 2024

from angle-grinder.

tallpsmith avatar tallpsmith commented on May 29, 2024

ah yes, using head (to make the file input smaller) works fine:

psmith@paul ~/temp/au1 $ head loggers.txt| agrind '* | parse "*" as logger | count by logger' > foo
psmith@paul ~/temp/au1 $ cat foo
logger                       _count
-------------------------------------------
[it.timing.LoggerSink        7
[main.TasksRepository        1
[OrbStatisticsControl        1
[essFaxDeliveryAction        1

So input/output buffering issue?

I'd be happy to try to build from source and try out the tip of branches (good chance to get my shirt sleeves rolled up with the Rust ecosystem)

from angle-grinder.

rcoh avatar rcoh commented on May 29, 2024

from angle-grinder.

tallpsmith avatar tallpsmith commented on May 29, 2024

Running 0.7.4 via git checkout and cargo install. Same behaviour.

interesting observations:

  • OSX shows agrind buring about 1 core, so it's definitely doing something
  • Spindump (attached) shows the threads doing merge-sort so that does also indicate it's "doing something"

So your idea on performance difference based on the standard output does sound about right, but I am not sure why that would be so. Will be interesting to see what you find!

agrind-Spindump.txt

from angle-grinder.

tallpsmith avatar tallpsmith commented on May 29, 2024

Also for context, the size of this file is 757MB:

$ wc  loggers.txt
 36071659 36073508 793576498 loggers.txt

from angle-grinder.

rcoh avatar rcoh commented on May 29, 2024

from angle-grinder.

rcoh avatar rcoh commented on May 29, 2024

Should be fixed by 7eae04e

from angle-grinder.

rcoh avatar rcoh commented on May 29, 2024

By the way @tallpsmith not sure what kind of cumulative you mean, but you can do things like:

* | parse "*" as logger | count by logger | sum not sure if that's what you meant

from angle-grinder.

tallpsmith avatar tallpsmith commented on May 29, 2024

taking the tip of master (which still says 0.7.4 btw, even though there's a 0.7.5 tag)

psmith@paul ~/temp/au1 $ time cat loggers.txt| agrind '* | parse "*" as logger | count by logger' > foo

real	1m15.623s
user	2m15.256s
sys	0m10.300s

Great Success! https://media.giphy.com/media/a0h7sAqON67nO/giphy.gif

(and it's even faster than with it displaying to tty..)

from angle-grinder.

tallpsmith avatar tallpsmith commented on May 29, 2024

Also in response to:

* | parse "*" as logger | count by logger | sum not sure if that's what you meant

 cat loggers.txt| agrind '* | parse "*" as logger | count by logger | sum'
Failure parsing query. Parse failed at: Error(Code(CompleteStr("| sum"), Eof))

I'm not sure how the heck Sumologic does it, but I was thinking of something like the accum operator: https://help.sumologic.com/Search/Search-Query-Language/Search-Operators/accum

So a running total along side the previous column. That was the idea I was getting towards anyway.

from angle-grinder.

tallpsmith avatar tallpsmith commented on May 29, 2024

thanks for the quick turn around!

from angle-grinder.

Related Issues (20)

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.