Comments (14)
from angle-grinder.
from angle-grinder.
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.
from angle-grinder.
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.
from angle-grinder.
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!
from angle-grinder.
Also for context, the size of this file is 757MB:
$ wc loggers.txt
36071659 36073508 793576498 loggers.txt
from angle-grinder.
from angle-grinder.
Should be fixed by 7eae04e
from angle-grinder.
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.
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.
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.
thanks for the quick turn around!
from angle-grinder.
Related Issues (20)
- Plain text | json | csv output for aggregated data HOT 4
- Outdated `Cargo.lock` file? HOT 6
- sort could cater for version numbers HOT 3
- windows support - `cargo install ag` failed HOT 3
- ag Crash Report HOT 2
- Allow filtering on missing variables HOT 1
- Be less eager to use live-updating table HOT 5
- Error self-updating from v0.15.0 to v0.16 HOT 3
- Version v0.16 does not build with rust >= 1.52 HOT 1
- Splitting within an ANSI color code causes all output to be printed in that color HOT 2
- Support reading from multiple files HOT 2
- Support tee-like output direction HOT 1
- Allow compound expressions in `where` HOT 5
- Error when parsing regex HOT 3
- Access to the raw input
- Support for applying sliding window to aggregates
- Support nodrop directive on split HOT 2
- Crash while parsing syslog for netfilter logs HOT 4
- Cargo.lock is not updated for 0.19.1 release HOT 1
- Crash while parsing netfilter using regex HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angle-grinder.