TeamsStatus icon indicating copy to clipboard operation
TeamsStatus copied to clipboard

Improve performance / reduce CPU load and disk IO

Open andreasbrett opened this issue 3 years ago • 7 comments

Tail'ing the last 1000 lines twice every second results in unnecessary CPU load and disk I/O. I changed this to use the -Wait feature of Get-Content. Could shave down CPU usage from 3-4% to 0-1%.

First run will fetch the last 1000 lines of the Teams logfile and process them. After that Get-Content will monitor the file for changes and only report those to the subsequent Scriptblock.

andreasbrett avatar Nov 25 '21 15:11 andreasbrett

nice, running this and it works well

jimmyeao avatar Dec 03 '21 18:12 jimmyeao

This is really nice. I seem to get an error when I use the script from this commit. Any idea what I might be doing wrong?

image

vmax77 avatar Dec 15 '21 09:12 vmax77

This is really nice. I seem to get an error when I use the script from this commit. Any idea what I might be doing wrong?

image

Sorry, I can't help here. I'm not using this script as a service as that is not permitted on my work laptop (for good reasons).

andreasbrett avatar Dec 15 '21 10:12 andreasbrett

I'm using as a service and it's working for me just fine. I would advise to merge this, as it brings major benefits.

felipecrs avatar Dec 21 '21 18:12 felipecrs

I fixed it with changing the ENV var back to full path, and then it works

vmax77 avatar Dec 22 '21 08:12 vmax77

im using this as a service with the full path not env and its working great.

chriscolden avatar Jan 24 '22 17:01 chriscolden

Since this project seems abandoned I've created a copy here: https://github.com/AntoineGS/TeamsStatusV2 I have merged your PR in it already!

AntoineGS avatar Jun 14 '22 01:06 AntoineGS