Skip to content

Commit

Permalink
Merge branch 'hotfix/cpuhotfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonscott committed May 13, 2014
2 parents 82ab72d + eb85749 commit cc8a1fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CadenceHost/Windows/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:helpers="clr-namespace:CadenceHost.Helpers"
Title="MainWindow" Height="418.06" Width="1089.657" ResizeMode="NoResize" WindowStyle="None" MouseDown="Window_MouseDown" Closing="OnWindowClosing" Icon="../Images/CadenceIcon.ico">
Title="MainWindow" Height="418.06" Width="1089.657" ResizeMode="NoResize" WindowStyle="None" MouseDown="Window_MouseDown" Icon="../Images/CadenceIcon.ico">
<Grid>
<Border BorderBrush="#FF7C7C7C" BorderThickness="4,4,4,4" />
<StackPanel Background="#FF4A90E2" Margin="4,4,3.6,341.4" Orientation="Horizontal">
Expand Down
7 changes: 4 additions & 3 deletions CadenceHost/Windows/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,21 @@ public MainWindow()

private void OnPulse(object sender, EventArgs e)
{
//We hold onto this one so we don't skip two cycles (the next one is usually 0)
var currentCpu = _statsHelper.GetCurrentCpu();

AddDebugInfo(

String.Format("Sending Pulse - CPU: {0}, RAM: {1}, Disk Usage: {2} and Uptime: {3}",
_statsHelper.GetCurrentCpu(), _statsHelper.GetCurrentRamPercent(), _statsHelper.GetFreeDiskStorageAsPercentage(), _statsHelper.GetUptime()));
String.Format("Sending Pulse - CPU: {0}, RAM: {1}, Disk Usage: {2} and Uptime: {3}", currentCpu
, _statsHelper.GetCurrentRamPercent(), _statsHelper.GetFreeDiskStorageAsPercentage(), _statsHelper.GetUptime()));

var timeSpan = (DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0));

var dataToSend = new NameValueCollection
{
{"server_id", _serverId.ToString(CultureInfo.InvariantCulture)},
{"ram_usage", _statsHelper.GetCurrentRamPercent()},
{"cpu_usage", _statsHelper.GetCurrentCpu()},
{"cpu_usage", currentCpu},
{"disk_usage", _statsHelper.GetFreeDiskStorageAsPercentage()},
{"uptime", _statsHelper.GetUptime().ToString(CultureInfo.InvariantCulture)},
{"timestamp", timeSpan.TotalSeconds.ToString(CultureInfo.InvariantCulture)}
Expand Down

0 comments on commit cc8a1fa

Please sign in to comment.