@@ -110,17 +110,9 @@ function acquia_cms_install_tasks(): array {
110
110
}
111
111
112
112
$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
+ ];
124
116
return $tasks;
125
117
}
126
118
@@ -131,20 +123,7 @@ function acquia_cms_install_tasks(): array {
131
123
*/
132
124
function install_acms_send_heartbeat_event() {
133
125
$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'));
148
127
}
149
128
150
129
/**
0 commit comments