|
@@ -164,4 +164,23 @@ class RedisService extends Redis implements CollectorInterface
|
|
|
return array();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param string $key
|
|
|
+ */
|
|
|
+ public function hgetall($key, $output = false)
|
|
|
+ {
|
|
|
+ $start = microtime(true);
|
|
|
+ $_data = parent::hgetall($key);
|
|
|
+ $end = microtime(true);
|
|
|
+ $t = $end - $start;
|
|
|
+ if ($output) {
|
|
|
+ print_r("HGET '{$key}': {$t} segundos" . PHP_EOL);
|
|
|
+ }
|
|
|
+
|
|
|
+ if($_data)
|
|
|
+ return json_decode($_data,true);
|
|
|
+
|
|
|
+ return array();
|
|
|
+ }
|
|
|
+
|
|
|
}
|