@@ -23,7 +23,7 @@ |
||
| 23 | 23 | $actual = count($labels); |
| 24 | 24 | |
| 25 | 25 | if ($expected !== $actual) { |
| 26 | - throw new LabelException("Expected {$expected} label values but {$actual} were given."); |
|
| 26 | + throw new LabelException("expected {$expected} label values but {$actual} were given."); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | return new Collection([ |
@@ -56,14 +56,14 @@ |
||
| 56 | 56 | switch (true) { |
| 57 | 57 | case $metric instanceof Histogram: |
| 58 | 58 | return $metric->builder($items->merge($this->repository->get("{$key}:SUM"))) |
| 59 | - ->samples(); |
|
| 59 | + ->samples(); |
|
| 60 | 60 | case $metric instanceof Summary: |
| 61 | 61 | return $metric->builder($items->map(function (string $key) { |
| 62 | 62 | return $this->repository->get($key); |
| 63 | 63 | }))->samples(); |
| 64 | 64 | default: |
| 65 | 65 | return $metric->builder($items) |
| 66 | - ->samples(); |
|
| 66 | + ->samples(); |
|
| 67 | 67 | } |
| 68 | 68 | } catch (Exception $e) { |
| 69 | 69 | $class = get_class($metric); |
@@ -65,7 +65,8 @@ discard block |
||
| 65 | 65 | return $metric->builder($items) |
| 66 | 66 | ->samples(); |
| 67 | 67 | } |
| 68 | - } catch (Exception $e) { |
|
| 68 | + } |
|
| 69 | + catch (Exception $e) { |
|
| 69 | 70 | $class = get_class($metric); |
| 70 | 71 | |
| 71 | 72 | throw new StorageException("Failed to collect the samples of [{$class}]: {$e->getMessage()}", 0, $e); |
@@ -83,9 +84,11 @@ discard block |
||
| 83 | 84 | $this->labeled($metric, $labels)->toJson(), |
| 84 | 85 | $value |
| 85 | 86 | ); |
| 86 | - } catch (LabelException $e) { |
|
| 87 | + } |
|
| 88 | + catch (LabelException $e) { |
|
| 87 | 89 | throw $e; |
| 88 | - } catch (Exception $e) { |
|
| 90 | + } |
|
| 91 | + catch (Exception $e) { |
|
| 89 | 92 | $class = get_class($metric); |
| 90 | 93 | |
| 91 | 94 | throw new StorageException("Failed to increment [{$class}] by `{$value}`: {$e->getMessage()}", 0, $e); |
@@ -103,9 +106,11 @@ discard block |
||
| 103 | 106 | $this->labeled($metric, $labels)->toJson(), |
| 104 | 107 | $value |
| 105 | 108 | ); |
| 106 | - } catch (LabelException $e) { |
|
| 109 | + } |
|
| 110 | + catch (LabelException $e) { |
|
| 107 | 111 | throw $e; |
| 108 | - } catch (Exception $e) { |
|
| 112 | + } |
|
| 113 | + catch (Exception $e) { |
|
| 109 | 114 | $class = get_class($metric); |
| 110 | 115 | |
| 111 | 116 | throw new StorageException("Failed to decrement [{$class}] by `{$value}`: {$e->getMessage()}", 0, $e); |
@@ -133,7 +138,8 @@ discard block |
||
| 133 | 138 | $this->repository->set($key, $field, $identifier, false); |
| 134 | 139 | $this->repository->push($identifier, $value); |
| 135 | 140 | } |
| 136 | - } catch (Exception $e) { |
|
| 141 | + } |
|
| 142 | + catch (Exception $e) { |
|
| 137 | 143 | $class = get_class($metric); |
| 138 | 144 | |
| 139 | 145 | throw new StorageException("Failed to observe [{$class}] with `{$value}`: {$e->getMessage()}", 0, $e); |
@@ -151,9 +157,11 @@ discard block |
||
| 151 | 157 | $this->labeled($metric, $labels)->toJson(), |
| 152 | 158 | $value |
| 153 | 159 | ); |
| 154 | - } catch (LabelException $e) { |
|
| 160 | + } |
|
| 161 | + catch (LabelException $e) { |
|
| 155 | 162 | throw $e; |
| 156 | - } catch (Exception $e) { |
|
| 163 | + } |
|
| 164 | + catch (Exception $e) { |
|
| 157 | 165 | $class = get_class($metric); |
| 158 | 166 | |
| 159 | 167 | throw new StorageException("Failed to set [{$class}] to `{$value}`: {$e->getMessage()}", 0, $e); |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | $index = (int) $position; |
| 92 | 92 | |
| 93 | 93 | $value = floor($position) === $position |
| 94 | - ? ($values->get($index -1) + $values->get($index))/2 |
|
| 94 | + ? ($values->get($index - 1) + $values->get($index)) / 2 |
|
| 95 | 95 | : $values->get($index); |
| 96 | 96 | |
| 97 | 97 | return compact('quantile', 'value'); |