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

Calculations in the statistics #1307

Open
gmollygreen opened this issue May 25, 2022 · 0 comments
Open

Calculations in the statistics #1307

gmollygreen opened this issue May 25, 2022 · 0 comments

Comments

@gmollygreen
Copy link

Hello,
I use deepl for translating german/english.

I have had opendcim in function for a while and enjoy the database application. Unfortunately, I also keep running into problems.
Now I have come across the strange calculation after looking at the code for me and don't understand the connection. The programmer may have thought of something that is not clear to me.

$dcStats["Available"]=$dcStats["TotalU"] - $dcStats["Occupied"] - $dcStats["Infrastructure"] - $dcStats["Allocated"]; With this calculation I only have "negative" results for the value "Available" in my datacenter.

Why is everything added to Infrastructure if the status is not SERVER or Storage?

$sql="SELECT SUM(a.Height) as TotalU FROM fac_Device a,fac_Cabinet b WHERE
a.Cabinet=b.CabinetID AND b.DataCenterID=$this->DataCenterID AND ParentDevice=0 AND
a.DeviceType NOT IN ('Server','Storage Array') and a.Status NOT IN ('Reserved', 'Salvage') and a.Cabinet>0;";
$dcStats["Infrastructure"]=($test=$this->query($sql)->fetchColumn())?$test:0;

By infrastructure I mean that this is "necessary" hardware or panels. Then I can label that hardware "infrastucture". In opendcim, however, components are counted which are DeviceType not Server or Storage Array.
In my case I have
TOTAL U 3,470; Infrastructure 1,493; Occupied 783; Allocated 2,262 => Avaible -1,068
According to this, my data centre would be 1.068 U over-occupied!

I would like to adjust/correct this calculation (zone_stats.php), or give the table other headings.
Also reserved units are not shown.
I would also like to discuss the topic and understand the previous context if necessary. I would assign/assign the theme (ID) infrastructure manually and not via the rule.

What does "salvage" stand for?

I look forward to feedback.

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

No branches or pull requests

1 participant