# Rework of the Graphstats webpage

**URL:** <https://klipper.discourse.group/t/rework-of-the-graphstats-webpage/16765>\
**Category:** General Discussion\
**Created:** [May 31, 2024, 5:27pm UTC](https://klipper.discourse.group/t/rework-of-the-graphstats-webpage/16765 "2024-05-31T17:27:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [May 31, 2024, 5:27pm UTC](https://klipper.discourse.group/t/rework-of-the-graphstats-webpage/16765/1 "2024-05-31T17:27:06Z")

</div>

I have reworked the web implementation of Klipper’s `graphstats.py` script.  
Notable changes are:

- It now displays printer starts and shutdowns
- Displays all found MCUs automatically
- Displays all found heaters / temperatures automatically
- Add some advanced MCU stats
- It aligns the Klipper internal timestamps with human-readable time
- Allows to drill down to a session. A session is always detected between a printer start and a shutdown
- Fixes an issue, where under certain conditions (e.g. reboot of the host) a negative time jump could occur in the graphed data

Currently, I have not replaced the old implementation, as I would appreciate some feedback and testing before doing so.

The new version can be tested here: [Graph Klipper Stats](https://sineos.github.io/index2.html)

Any testing, feedback or improvements are more than welcome. If anybody with more web-dev skills feels like improving the looks of it, I’d very much appreciate as well.

---

<div class="post-metadata">

**Author:** ![hcet14](https://avatars.discourse-cdn.com/v4/letter/h/ecd19e/32.png) [@hcet14](https://klipper.discourse.group/u/hcet14)\
**Post date:** [June 1, 2024, 11:46am UTC](https://klipper.discourse.group/t/rework-of-the-graphstats-webpage/16765/2 "2024-06-01T11:46:24Z")

</div>

> [@Sineos](#):
>
> Any testing, feedback or improvements are more than welcome.

Thanks, very nice improvements.

I tried to process the klippy.log from [Klipper restarts mid print and canceling print](https://klipper.discourse.group/t/klipper-restarts-mid-print-and-canceling-print/16774)  
Flawless.

Then I was looking for a bigger klippy.log. [MCU ‘sb2040’ shutdown: Timer too close](https://klipper.discourse.group/t/mcu-sb2040-shutdown-timer-too-close/16413)  
Didn’t process. I renamed the file to klippy.log, still no procession.

I did it with “Microsoft Edge Version 125.0.2535.79 (Official build) (64-bit)” under  
Edition Windows 10 Pro  
Version 22H2  
Installed on ‎16.‎07.‎2021  
OS build 19045.4412  
Experience Windows Feature Experience Pack 1000.19056.1000.0

I’ll try other scenarios.

Edit: Tried the failed log with your old “[https://sineos.github.io/](https://sineos.github.io/)”.  
Flawless.

 ![image](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/8/82e81ff2d1a61f8bcd056b813f48a0b736fb9215.png)  
Edit: Tried the failed log with  
 ![image](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/6/6d350f2eac152d8840edd372fc9fe74fb5ec0ea7.png)  
Flawless.  
 ![image](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/1/140ec328b701f513b8268bff05d755d32a2141c5.png)

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [June 1, 2024, 5:19pm UTC](https://klipper.discourse.group/t/rework-of-the-graphstats-webpage/16765/3 "2024-06-01T17:19:11Z")

</div>

Thanks for destroying all my illusions that it would work right from the start!

Just kidding, your tests are very much appreciated. Indeed, it seems that Edge is more sensitive and I have to admit I only tested in FF and Chrome.

I’ll see what I can do to make it more robust.  
In any case, throwing a 60MB log at will take some time to be processed and graphed, especially since the graphs are dynamic.

---

<div class="post-metadata">

**Author:** ![hcet14](https://avatars.discourse-cdn.com/v4/letter/h/ecd19e/32.png) [@hcet14](https://klipper.discourse.group/u/hcet14)\
**Post date:** [June 2, 2024, 10:26am UTC](https://klipper.discourse.group/t/rework-of-the-graphstats-webpage/16765/4 "2024-06-02T10:26:57Z")

</div>

> [@Sineos](#):
>
> In any case, throwing a 60MB log at will take some time to be processed and graphed, especially since the graphs are dynamic.

Yes, it takes a while.

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [June 2, 2024, 6:47pm UTC](https://klipper.discourse.group/t/rework-of-the-graphstats-webpage/16765/5 "2024-06-02T18:47:43Z")

</div>

> [@hcet14](#):
>
> Didn’t process. I renamed the file to klippy.log, still no procession.

Should work now on Edge as well. No need to rename the logs. It doesn’t care about the extension.

---

<div class="post-metadata">

**Author:** ![hcet14](https://avatars.discourse-cdn.com/v4/letter/h/ecd19e/32.png) [@hcet14](https://klipper.discourse.group/u/hcet14)\
**Post date:** [June 2, 2024, 7:44pm UTC](https://klipper.discourse.group/t/rework-of-the-graphstats-webpage/16765/6 "2024-06-02T19:44:05Z")

</div>

> [@Sineos](#):
>
> Should work now on Edge as well. No need to rename the logs. It doesn’t care about the extension.

Yes, sir. Thanks a bunch. Nice tool to investigate a “klippy.log” 🕶

---

<div class="post-metadata">

**Author:** ![TheFuzzyGiggler](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/thefuzzygiggler/32/12313_2.png) [@TheFuzzyGiggler](https://klipper.discourse.group/u/TheFuzzyGiggler)\
**Post date:** [June 3, 2024, 1:52am UTC](https://klipper.discourse.group/t/rework-of-the-graphstats-webpage/16765/7 "2024-06-03T01:52:54Z")

</div>

I threw a 240MB log at it (I just copied a large log over and over and appended at the bottom). It broke everything. Locked up my tab. Didn’t display anything. 0/10.

I blame Sineos for Chrome trying to use 5GB of ram to read a 240MB file.

 ![image](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/3/3746be1b357f5e3cb357eefb03fa0d928ea1e800.png)

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [June 3, 2024, 6:13am UTC](https://klipper.discourse.group/t/rework-of-the-graphstats-webpage/16765/8 "2024-06-03T06:13:41Z")

</div>

> [@TheFuzzyGiggler](#):
>
> I blame Sineos for Chrome trying to use 5GB of ram to read a 240MB file.

Most likely true. Luckily, I can probably live with the fact that a 240MB won’t parse.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/klipper/original/1X/64419bf2aac6639e6ef5cef200dcd456b0a01ac3.png) [@system](https://klipper.discourse.group/u/system)\
**Post date:** [August 2, 2024, 6:14am UTC](https://klipper.discourse.group/t/rework-of-the-graphstats-webpage/16765/9 "2024-08-02T06:14:01Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
