Skip to content

Commit

Permalink
adding EnvionrmentVar collector
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickKutch committed Jan 13, 2022
1 parent 204814d commit bea82b9
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Marvin/Widget/CPU/ChartBarFrequency.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
Document : nothing yet
*/
.default-color0.chart-bar { -fx-bar-fill: CHART_COLOR_1;
-fx-background-color: linear-gradient(to top,
#0071C5 0%,
rgb(20,20,200) 75%,
rgb(100,20,100) 85%,
rgb(200,50,100) 95%,
rgb(255,0,0) 100%
);
}
27 changes: 27 additions & 0 deletions Marvin/Widget/CPU/ChartBarFrequency.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
##############################################################################
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##############################################################################
# File Abstract:
#
##############################################################################
-->

<Widget Type = "BarChart">
<Style>ChartBarFrequency.css</Style>
<Animated>True</Animated>
<yAxis MajorTickInterval="1" MinorTickInterval="0" TickLabelVisible="True"/>
</Widget>
27 changes: 27 additions & 0 deletions Minion/Collectors/EnvironmentVar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
##############################################################################
# Copyright (c) 2032 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##############################################################################
# File Abstract:
# Gets or Sets an enviroment variable
#
##############################################################################
import os

def SetEnvValue(envVarName, envVarVal):
os.environ[envVarName] = str(envVarVal)

def GetEnvValue(envVarName):
return os.environ.get(envVarName, "Not Set")

12 changes: 12 additions & 0 deletions Minion/Collectors/Linux_CPU.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,18 @@ def GetSystemAverageCPU(interval=.1,precision=2):

return str(format(total,strPrecision))

def GetCoreCount():
coreCount = 0
for cpuDir in os.listdir(GetBaseDir()):
if not 'cpu' in cpuDir:
continue

if cpuDir in ['cpufreq','cpuidle']: #don't want these directories
continue

coreCount+=1

return coreCount

## Dynamic Collector interface, gets all raw stats
def CollectStatsFunction(frameworkInterface):
Expand Down
2 changes: 1 addition & 1 deletion Minion/Helpers/_Version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# External file containing the version string for the application
#
##############################################################################
__version__ = "21.12.30 Build 1"
__version__ = "22.01.13 Build 1"

0 comments on commit bea82b9

Please sign in to comment.