Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report resource and processing stats to stderr #129

Merged
merged 3 commits into from Feb 22, 2024

Conversation

DrJosh9000
Copy link
Contributor

@DrJosh9000 DrJosh9000 commented Feb 21, 2024

More data is needed in order to quantify the impact of changes like #126 on real-world terminal output.

  • How much CPU time (as distinct from wall-clock time) is needed? How much in the system, how much in the process itself?
  • What about memory consumption? Allocations, frees?
  • Filesystem accesses? Page faults? Garbage collection?
  • How often do cursor move commands try to scroll out of bounds? What if we set MaxLines?

Pass --log-stats-to-stderr, receive JSON object with stats on stderr.

Example:

% cat fixtures/npm.sh.raw | go run ./cmd/terminal-to-html --log-stats-to-stderr > /dev/null 
{"Rtime":19621916,"Utime":21790000,"Stime":7932000,"MaxRSS":24461312,"MinorFaults":1720,"MajorFaults":0,"FSInBlocks":0,"FSOutBlocks":0,"InputBytes":558760,"OutputBytes":933880,"LinesScrolledOut":0,"CursorUpOOB":0,"CursorBackOOB":0,"TotalAlloc":19199720,"HeapAlloc":10241080,"HeapInuse":11411456,"Mallocs":160501,"Frees":136811,"PauseTotalNs":220376,"NumGC":4,"GCCPUFraction":0.019161677967035995}

Copy link
Contributor

@triarius triarius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@DrJosh9000 DrJosh9000 merged commit 293a984 into main Feb 22, 2024
1 check passed
@DrJosh9000 DrJosh9000 deleted the report-resource-stats branch February 22, 2024 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants