labtech
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
PerfScore
Parameters
Name
Type
Mode
CID
int
IN
Definition
BEGIN Declare score int; Declare result int; Declare Total int; SELECT 1 As Result, 1 as Total,IFNULL(ROUND(100-((SUM(IF(h_computerstatsdaily.MEM<MemoryLimit,1*(MemoryWeight*.01),0)) + SUM(IF(h_computerstatsdaily.CPU>CPULimit,1*(CPUWeight*.01),0)))/ ((Count(*) * (1*(MemoryWeight*.01)))+(Count(*) * (1*(CPUWeight*.01))))) *100),100) as PerfScore FROM managementScore,h_computerstatsdaily Join Computers Using (ComputerID) Where h_computerstatsdaily.EventDate=DATE(DATE_ADD(CURDATE(),interval -1 day)) and Computers.ClientID=CID into @result,@total,@score; return @score; END