Skip to content

Commit 7043627

Browse files
authored
Merge pull request #1617 from acquia/ACMS-1932-1.5.x
ACMS-1932: Capture and send Acquia Sites data to telemetry.
2 parents 4b0f74e + c03b129 commit 7043627

File tree

2 files changed

+6
-26
lines changed

2 files changed

+6
-26
lines changed

acquia_cms.profile

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,9 @@ function acquia_cms_install_tasks(): array {
110110
}
111111

112112
$tasks['install_acms_finished'] = [];
113-
114-
// Don't include the rebuild task & don't send heartbeat event to telemetry.
115-
// if installing site via Drush.
116-
// @see src/Commands/SiteInstallCommands.php.
117-
// Also send hearbeat event only for UI here.
118-
// For cli we are sending it from file mentioned above.
119-
if (PHP_SAPI !== 'cli') {
120-
$tasks['install_acms_send_heartbeat_event'] = [
121-
'run' => Drupal::service('module_handler')->moduleExists('acquia_connector') && Environment::isAhEnv() ? INSTALL_TASK_RUN_IF_NOT_COMPLETED : INSTALL_TASK_SKIP,
122-
];
123-
}
113+
$tasks['install_acms_send_heartbeat_event'] = [
114+
'run' => Drupal::service('module_handler')->moduleExists('acquia_connector') && Environment::isAhEnv() ? INSTALL_TASK_RUN_IF_NOT_COMPLETED : INSTALL_TASK_SKIP,
115+
];
124116
return $tasks;
125117
}
126118

@@ -131,20 +123,7 @@ function acquia_cms_install_tasks(): array {
131123
*/
132124
function install_acms_send_heartbeat_event() {
133125
$telemetry = Drupal::classResolver(AcquiaTelemetry::class);
134-
$telemetry_service = \Drupal::service('acquia_connector.telemetry');
135-
$config = \Drupal::config('cohesion.settings');
136-
$cohesion_configured = $config->get('api_key') && $config->get('organization_key');
137-
\Drupal::configFactory()
138-
->getEditable('acquia_connector.settings')
139-
->set('spi.amplitude_api_key', 'e896d8a97a24013cee91e37a35bf7b0b')
140-
->save();
141-
$telemetry_service->sendTelemetry('acquia_cms_installed', [
142-
'Application UUID' => Environment::getAhApplicationUuid(),
143-
'Site Environment' => Environment::getAhEnv(),
144-
'Install Time' => $telemetry->calculateTime('install_start_time', 'install_end_time'),
145-
'Rebuild Time' => $telemetry->calculateTime('rebuild_start_time', 'rebuild_end_time'),
146-
'Site Studio Install Status' => $cohesion_configured ? 1 : 0,
147-
]);
126+
\Drupal::state()->set('acquia_cms.telemetry.install_time', $telemetry->calculateTime('install_start_time', 'install_end_time'));
148127
}
149128

150129
/**

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@
6060
"oomphinc/composer-installers-extender": true,
6161
"php-http/discovery": true,
6262
"phpro/grumphp-shim": true,
63-
"webdriver-binary/binary-chromedriver": true
63+
"webdriver-binary/binary-chromedriver": true,
64+
"phpstan/extension-installer": true
6465
},
6566
"preferred-install": {
6667
"drupal/core": "dist"

0 commit comments

Comments
 (0)