Skip to content

Commit 9720c66

Browse files
committed
Metrics not work for node sites.
1 parent a141960 commit 9720c66

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Commands/Env/MetricsCommand.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ public function metrics(
8484
'datapoints' => 'auto',
8585
]
8686
) {
87+
$site = $this->getSiteById($site_env);
88+
if ($site->isNodejs()) {
89+
throw new TerminusException(
90+
'Metrics are not yet available for Node.js sites.'
91+
);
92+
}
8793
$env = $this->getOptionalEnv($site_env);
8894
if (null !== $env) {
8995
$metrics = $env->getEnvironmentMetrics()
@@ -95,8 +101,7 @@ public function metrics(
95101
)
96102
->serialize();
97103
} else {
98-
$metrics = $this->getSiteById($site_env)
99-
->getSiteMetrics()
104+
$metrics = $site->getSiteMetrics()
100105
->setDuration(
101106
$this->selectDatapoints(
102107
$options['datapoints'],

0 commit comments

Comments
 (0)