Announcement

Collapse
No announcement yet.

it's possible to get the disk usage percentage?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • it's possible to get the disk usage percentage?

    I am trying to show the 3 values of use on the PC as they are seen in the task manager, for the CPU and the RAM I obtain it using System.GetMemoryInfo, but for the case of the disk I cannot find a way to show it. As much as I investigate, the only thing that I achieve is to show the available capacity and other static data of the disk with Drive.GetInformation, I want to show the use in real time as it is achieved with the CPU and RAM


    I use the ProgressBarCircleEx plugin although with the traditional progress bar I can't either. If you know any solution, I appreciate it.







    Attached Files

  • #2
    Something like this

    Click image for larger version

Name:	sys1.png
Views:	249
Size:	37.3 KB
ID:	307605 Click image for larger version

Name:	sys2.png
Views:	165
Size:	18.9 KB
ID:	307606

    Code:
    --Get Local HDD information
    LocalHDD = Drive.GetInformation("C:");
    nDrive = LocalHDD.DisplayName
    nType = LocalHDD.FileSystem
    dInfo = nDrive.." , "..nType
    nLabel = LocalHDD.Label
    Label.SetText("Ldrive", dInfo);
    --set drive image for win10 or 7
    if nLabel == "Win10" then
    Image.SetVisible("Iw10hdd", true);
    elseif nDrive == "Win7" then
    Image.SetVisible("Iw7hdd", true);
    else
    Image.SetVisible("Ifhdd", true);
    end
    
    -- Display each drive and drive-type in Combobox
    tdrives = Drive.Enumerate();
    for k in pairs (tdrives) do
    
    dtype = Drive.GetType (tdrives[k])
    if dtype == 2 or dtype == 3 then
    dletter = String.Left(tdrives[k], 2);
    ComboBox.AddItem("ComboBox1", dletter, dtype);
    end
    end
    Code for HDD at top, let you figure combobox code
    Cheers

    Comment


    • #3
      Originally posted by colc View Post
      Something like this

      Click image for larger version

Name:	sys1.png
Views:	249
Size:	37.3 KB
ID:	307605 Click image for larger version

Name:	sys2.png
Views:	165
Size:	18.9 KB
ID:	307606

      Code:
      --Get Local HDD information
      LocalHDD = Drive.GetInformation("C:");
      nDrive = LocalHDD.DisplayName
      nType = LocalHDD.FileSystem
      dInfo = nDrive.." , "..nType
      nLabel = LocalHDD.Label
      Label.SetText("Ldrive", dInfo);
      --set drive image for win10 or 7
      if nLabel == "Win10" then
      Image.SetVisible("Iw10hdd", true);
      elseif nDrive == "Win7" then
      Image.SetVisible("Iw7hdd", true);
      else
      Image.SetVisible("Ifhdd", true);
      end
      
      -- Display each drive and drive-type in Combobox
      tdrives = Drive.Enumerate();
      for k in pairs (tdrives) do
      
      dtype = Drive.GetType (tdrives[k])
      if dtype == 2 or dtype == 3 then
      dletter = String.Left(tdrives[k], 2);
      ComboBox.AddItem("ComboBox1", dletter, dtype);
      end
      end
      Code for HDD at top, let you figure combobox code
      Cheers
      Thanks for the answer, but I think I did not explain correctly I meant that I need to show the load percentage of the local disk C, for example when you are not doing anything it is at 0% but when you are unzipping or installing something on that disk it begins to increase its use according to the speed of the disk as well as the CPU. (I'm not interested in the available space)

      Comment


      • #4
        I'm sorry but
        it's possible to get the disk usage percentage?
        HDD do not have load non load %

        Click image for larger version

Name:	HDD Mon.png
Views:	172
Size:	94.0 KB
ID:	307610

        Comment


        • #5
          [QUOTE=colc;n307609]I'm sorry but


          HDD do not have load non load %

          you are right I was wrong to say "use" because I do not know the correct term, but then that percentage with which it will be calculated?


          Attached Files

          Comment


          • #6
            so what i need to show is called active time

            Comment


            • #7
              get percent from progress first

              PHP Code:
              Input.SetText("Input2"Math.Floor(HDDFree/1024).." GB free  "..Math.Floor(HDDused/1024).." GB used  ".."["..nPercent.. "%]"); 


              Click image for larger version

Name:	screen.PNG
Views:	212
Size:	28.3 KB
ID:	307617

              Comment


              • #8
                Originally posted by herrin View Post
                get percent from progress first

                PHP Code:
                Input.SetText("Input2"Math.Floor(HDDFree/1024).." GB free "..Math.Floor(HDDused/1024).." GB used ".."["..nPercent.. "%]"); 

                Thanks, but as I was saying to Colc I had made a mistake in the title of the question, really what I need to show is called "Active Time" (I am not interested in showing the space used but the percentage of active time that is changing) and although I found this that could be used to show it, I don't know how to take that value to be able to show it in the progress bar with the ProgressBarCircleEx plugin

                https://serverfault.com/questions/85...ogrammatically

                Comment


                • #9
                  PercentDiskTime, although I don't need to do the calculation of all disks, only the local disk c


                  Click image for larger version

Name:	per.png
Views:	139
Size:	12.1 KB
ID:	307620

                  Comment


                  • #10
                    thing does not change


                    Click image for larger version

Name:	Cattura.PNG
Views:	192
Size:	61.2 KB
ID:	307624

                    Comment


                    • #11
                      Originally posted by herrin View Post
                      thing does not change
                      wow you got it ??? in the OnTimer tab when updating the value it should change but when executing a process that uses the hard disk such as unzipping a file on that disk or neither?

                      Comment


                      • #12
                        Or it will be because only the highest peak registers and it stays showing that value until there is one that exceeds it

                        Comment


                        • #13
                          Thanks u are good in ams

                          Comment


                          • #14
                            Thanks for guiding us with that

                            Comment

                            Working...
                            X