summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--PTS-12-CHANGE-LOG3
-rw-r--r--pts-core/modules/system_monitor.php2
-rw-r--r--pts-core/objects/pts_Graph.php9
-rw-r--r--pts-core/objects/pts_module.php31
4 files changed, 28 insertions, 17 deletions
diff --git a/PTS-12-CHANGE-LOG b/PTS-12-CHANGE-LOG
index 7afca26..b1994d4 100644
--- a/PTS-12-CHANGE-LOG
+++ b/PTS-12-CHANGE-LOG
@@ -9,3 +9,6 @@
- Add CPU usage monitoring support to pts-core
- system_monitor: Add cpu.usage to MONITOR, fix some bugs as well
- pts_LineGraph: Don't display the pointers if there are too many points on the graph
+- pts_Graph: Always show key/legend if it's a single-type line graph
+- pts_Graph: Use image antialiasing if it's available on the system
+- pts_module: If pcntl isn't present, don't thread and warn the user
diff --git a/pts-core/modules/system_monitor.php b/pts-core/modules/system_monitor.php
index 456c440..448a589 100644
--- a/pts-core/modules/system_monitor.php
+++ b/pts-core/modules/system_monitor.php
@@ -112,7 +112,7 @@ class system_monitor extends pts_module_interface
pts_module::save_file(".s/CPU_USAGE");
}
- pts_module::pts_timed_function(5, "pts_monitor_update");
+ pts_module::pts_timed_function(15, "pts_monitor_update");
}
public static function __shutdown($obj = NULL)
{
diff --git a/pts-core/objects/pts_Graph.php b/pts-core/objects/pts_Graph.php
index a9cdcbc..70fd87c 100644
--- a/pts-core/objects/pts_Graph.php
+++ b/pts-core/objects/pts_Graph.php
@@ -305,9 +305,12 @@ class pts_Graph
protected function render_graph_init()
{
$this->graph_image = imagecreate($this->graph_attr_width, $this->graph_attr_height);
- //imageantialias($this->graph_image, true);
+
imageinterlace($this->graph_image, true);
+ if(function_exists("imageantialias"))
+ imageantialias($this->graph_image, true);
+
// Initalize GD Colors
$this->graph_color_notches = $this->convert_hex_to_gd($this->graph_color_notches);
@@ -334,7 +337,7 @@ class pts_Graph
}
protected function render_graph_base()
{
- if(count($this->graph_data_title) > 1)
+ if(count($this->graph_data_title) > 1 || $this->graph_type == "LINE_GRAPH")
{
$num_key_lines = ceil(count($this->graph_data_title) / 4);
$this->graph_top_start = $this->graph_top_start + 8 + ($num_key_lines * 11);
@@ -420,7 +423,7 @@ class pts_Graph
}
protected function render_graph_key()
{
- if(count($this->graph_data_title) < 2)
+ if(count($this->graph_data_title) < 2 && $this->graph_type != "LINE_GRAPH")
return;
$key_counter = 0;
diff --git a/pts-core/objects/pts_module.php b/pts-core/objects/pts_module.php
index 18a8a01..f897078 100644
--- a/pts-core/objects/pts_module.php
+++ b/pts-core/objects/pts_module.php
@@ -92,27 +92,32 @@ class pts_module
}
public static function pts_timed_function($time, $function)
{
- if($time < 5 || $time > 300)
+ if($time < 15 || $time > 300)
return;
- $pid = pcntl_fork();
-
- if($pid != -1)
+ if(function_exists("pcntl_fork"))
{
- if($pid)
- {
- return $pid;
- }
- else
+ $pid = pcntl_fork();
+
+ if($pid != -1)
{
- while(!defined("PTS_TESTING_DONE") && !defined("PTS_END_TIME") && pts_process_active("phoronix-test-suite"))
+ if($pid)
{
- eval(self::module_name() . "::" . $function . "();"); // TODO: This can be cleaned up once PHP 5.3.0+ is out there and adopted
- sleep($time);
+ return $pid;
+ }
+ else
+ {
+ while(!defined("PTS_TESTING_DONE") && !defined("PTS_END_TIME") && pts_process_active("phoronix-test-suite"))
+ {
+ eval(self::module_name() . "::" . $function . "();"); // TODO: This can be cleaned up once PHP 5.3.0+ is out there and adopted
+ sleep($time);
+ }
+ exit(0);
}
- exit(0);
}
}
+ else
+ echo pts_string_header("NOTICE: php-pcntl must be installed for the " . self::module_name() . " module.");
}
private static function module_name()
{