mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-02 03:37:44 +08:00
Update Redis.php
This commit is contained in:
parent
5c137bcd79
commit
fdc59578a4
@ -62,9 +62,6 @@ class Redis implements Adapter
|
||||
*/
|
||||
private $connectionInitialized = false;
|
||||
|
||||
/**
|
||||
* Redis constructor.
|
||||
*/
|
||||
public function __construct(array $options = [])
|
||||
{
|
||||
$this->options = array_merge(self::$defaultOptions, $options);
|
||||
@ -74,7 +71,6 @@ class Redis implements Adapter
|
||||
/**
|
||||
* Create an instance from an established redis connection.
|
||||
* @param \Hyperf\Redis\Redis|\Redis $redis
|
||||
* @return Redis
|
||||
*/
|
||||
public static function fromExistingConnection($redis): self
|
||||
{
|
||||
@ -409,14 +405,9 @@ LUA
|
||||
return implode(':', [self::$prefix, $data['type'], $data['name']]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adapt redis cluster get tag
|
||||
*
|
||||
*/
|
||||
protected function getRedisTag($metricType): string
|
||||
{
|
||||
switch($metricType)
|
||||
protected function getRedisTag(string $metricType): string
|
||||
{
|
||||
switch($metricType) {
|
||||
case Counter::TYPE:
|
||||
return "{counter}";
|
||||
case Histogram::TYPE:
|
||||
@ -435,8 +426,7 @@ LUA
|
||||
*/
|
||||
private function getMetricGatherKey($metricType): string
|
||||
{
|
||||
switch($metricType)
|
||||
{
|
||||
switch($metricType) {
|
||||
case Counter::TYPE:
|
||||
return self::$prefix . Counter::TYPE . self::PROMETHEUS_METRIC_KEYS_SUFFIX . $this->getRedisTag(Counter::TYPE);
|
||||
case Histogram::TYPE:
|
||||
|
Loading…
Reference in New Issue
Block a user