Skip to content

Commit

Permalink
Merge pull request #5 from dwfreed/master
Browse files Browse the repository at this point in the history
There's always one core
Thank you Doug for the contribution!
  • Loading branch information
jamesottinger committed Dec 24, 2014
2 parents 84a0a99 + 6ebfaba commit 32224fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Linode/Longview/DataGetter/SysInfo.pm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ sub get {
return $dataref;
};

$dataref->{INSTANT}->{'SysInfo.cpu.cores'} = grep {/^processor/} @cpu_info;
my $cores = grep {/^processor/} @cpu_info;
# There's always at least 1 core
$dataref->{INSTANT}->{'SysInfo.cpu.cores'} = $cores || 1;
#<<<
($dataref->{INSTANT}->{'SysInfo.cpu.type'} =
(map { /^(?:model name|Processor)\s+:(.*)$/; $1 || ()} @cpu_info)[0])
Expand Down

0 comments on commit 32224fa

Please sign in to comment.