Jump to content

New Plugin - Disk Space


chef

Recommended Posts

Dibbes

[emoji2962] <--I hope that that mind blown emoji shows up...

1e just means 1 exponent, then the + or - gives the direction in which the decimal moves and lastly, the number says how many places.

 

So we know that 1 kilobyte is a 1000 bytes, so that's a 1 with three zeros, written differently: 1e+3

 

1GB is a 1 with 9 zeroes, so 1e+9. 10GB is a one with ten zeroes, so 1e+10.

 

Kilo = 3 zeroes

Mega = 6 zeroes

Giga = 9 zeroes

Tera = 12 zeroes

Peta = 15 zeroes

 

Etc.

 

Sent from my iPad using Tapatalk

Edited by Dibbes
  • Like 2
Link to comment
Share on other sites

C# seems to be okay with the exponent integer.

 

I think Dibbes just saved me a bunch of time with this new found way of writting long ints.

 

The threshold has been set to a whole drive value less10GB, which should allow for an hour and a bit of recorded TV based on what Spaceboy has said.

 

I'm not sure how it will do casting 1e+10 to a long value. The IDE is not yelling about it. Anything else shows a possible overflow error.

 

1.0.0.6

 

I hope that fixes the notifications issues.

Edited by chef
Link to comment
Share on other sites

CBers

 

@@chef I'm still getting the original messages, even though v1.0.0.4 is in use.

 

 

Still getting the same with v1.0.0.6.

  • Like 1
Link to comment
Share on other sites

1.0.0.7

                var totalSize = Math.Round(driveInfo.TotalSize / 1000000000.0) ; //GBs
                var freeSpace = Math.Round(driveInfo.AvailableFreeSpace / 1000000000.0); //GBs

                if ((totalSize - freeSpace) > 10.0) continue; //Bigger the 10GB we're good

That has to be it.

  • Like 1
Link to comment
Share on other sites

CBers

1.0.0.7

                var totalSize = Math.Round(driveInfo.TotalSize / 1000000000.0) ; //GBs
                var freeSpace = Math.Round(driveInfo.AvailableFreeSpace / 1000000000.0); //GBs

                if ((totalSize - freeSpace) > 10.0) continue; //Bigger the 10GB we're good
That has to be it.

OK, so most of my drives break that rule, as TotalSize is almost exactly the same as AvailableFreeSpace, so the result is effectively zero, causing a notification to be raised.

 

I think all you need to do is:

 

var freeSpace = Math.Round(driveInfo.AvailableFreeSpace / 1000000000.0); //GBs

if ((freespace / 1000000000.0) > 10) continue; 

Unless I'm wrong.

 

 

.

Edited by CBers
  • Like 1
Link to comment
Share on other sites

CBers

@@chef I see v1.0.0.8 was released, but what changes were made, as I'm still getting the same notifications, but for all of my drives now?

Link to comment
Share on other sites

maegibbons

@@CBers I think you are right.

 

If you have freespace just check if it is greater or less than 10GB. Total drive space is irrelavent if not using percentage.

 

Krs

 

 

Mark

 

Sent from my SM-N976B using Tapatalk

  • Like 2
Link to comment
Share on other sites

maegibbons

Things are not working so good I have had notofications from .8

 

Disk space almost full: D:\ (DATA) disk space almost full - 759.6 GB

 

 

Thats not full!!

 

Krs

 

Mark

 

Sent from my SM-N976B using Tapatalk

  • Like 1
Link to comment
Share on other sites

Yes, 1.0.0.9 should fix things.

 

Check if free space is less then 10 GB inorder to alert.

 

Sorry about that.

  • Like 1
Link to comment
Share on other sites

CBers

Not sure if this is expected, but the ST is taking 0 seconds to run.

 

2020-01-29 20:49:23.010 Debug TaskManager: Executing Disk Space Almost Full Notification
2020-01-29 20:49:23.024 Debug TaskManager: Disk Space Almost Full Notification Completed after 0 minute(s) and 0 seconds
I don't have any drives with less than 10Gb free, but I thought it might run for at least 1 second.

 

Not complaining, just curious if it's working as expected.

Link to comment
Share on other sites

Not sure if this is expected, but the ST is taking 0 seconds to run.

 

 

2020-01-29 20:49:23.010 Debug TaskManager: Executing Disk Space Almost Full Notification
2020-01-29 20:49:23.024 Debug TaskManager: Disk Space Almost Full Notification Completed after 0 minute(s) and 0 seconds
I don't have any drives with less than 10Gb free, but I thought it might run for at least 1 second.

 

Not complaining, just curious if it's working as expected.

Yes thank you for the reminder! I should have thrown a IProgress update in there to complete the task. I'll put one in now.

 

I meant to do that earlier but forgot.

Link to comment
Share on other sites

CBers

Yes thank you for the reminder! I should have thrown a IProgress update in there to complete the task. I'll put one in now.

 

I meant to do that earlier but forgot.

That's OK chef, you must be busy.

 

So you think that the plugin is running OK then?

Link to comment
Share on other sites

That's OK chef, you must be busy.

 

So you think that the plugin is running OK then?

I think so. I've added the progress report so it shouldn't look like it hangs (which was happening to me), but also increment as it moves through scanned drives.

 

1.0.1.0

 

 

I think it's working okay.

 

Thank you for taking the time to help get it working better. I think it has definitely leveraged more of embys API.

Edited by chef
  • Like 2
Link to comment
Share on other sites

Dibbes

@@chef I have a request: is there a way to get the free-space figure in MB/GB/TB when you do an "on mouse over" on the graphs? It's now displaying bytes...

Link to comment
Share on other sites

@@chef I have a request: is there a way to get the free-space figure in MB/GB/TB when you do an "on mouse over" on the graphs? It's now displaying bytes...

 

 

I've tried to do this. There is a way to code custom tooltips for chartJS, I've read the docs and I understand how to do it, so yes I'm pretty sure I can.

 

For now I was able to calculate the percentage of each part of the graph, because the long string of byte data was completely useless to anyone reading it.

 

The reason it's in bytes is because that is how the chart is drawn to get the most accurate results.

 

I'll work on custom tooltips next. 

  • Like 1
Link to comment
Share on other sites

Dibbes

I've tried to do this. There is a way to code custom tooltips for chartJS, I've read the docs and I understand how to do it, so yes I'm pretty sure I can.

 

For now I was able to calculate the percentage of each part of the graph, because the long string of byte data was completely useless to anyone reading it.

 

The reason it's in bytes is because that is how the chart is drawn to get the most accurate results.

 

I'll work on custom tooltips next. 

 

Thank you!

  • Like 1
Link to comment
Share on other sites

maegibbons

Hi

 

Working well. Many thanks.

 

Can you add in a parameter for free Space limit?

 

Preferably by drive but if not overall!

 

10GB IS too large for one of my legacy shares of only 40GB! It only has 2.8GB free and is triggering every hour.

 

I dont store media on that drive.

 

Krs

 

Mark

 

Sent from my SM-N976B using Tapatalk

  • Like 2
Link to comment
Share on other sites

Hi

 

Working well. Many thanks.

 

Can you add in a parameter for free Space limit?

 

Preferably by drive but if not overall!

 

10GB IS too large for one of my legacy shares of only 40GB! It only has 2.8GB free and is triggering every hour.

 

I dont store media on that drive.

 

Krs

 

Mark

 

Sent from my SM-N976B using Tapatalk

Yep.

  • Like 2
Link to comment
Share on other sites

This is weird, there is an error in my debugging and I don't understand it.

 

Saving the configuration the first time after adding new elements causes the UI to break.

But, why?

 

This is going to take a second more to finish.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...