From 792ec7fc85914be0842fa495c5300007ab146558 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 21 Feb 2023 17:07:01 +0000 Subject: [PATCH] utils/analytics: tweaks constants. This enables easier usage in `brew formula-analytics`. --- Library/Homebrew/utils/analytics.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/utils/analytics.rb b/Library/Homebrew/utils/analytics.rb index a521ddbdf6..1c1fd04adc 100644 --- a/Library/Homebrew/utils/analytics.rb +++ b/Library/Homebrew/utils/analytics.rb @@ -11,15 +11,16 @@ module Utils # # @api private module Analytics + INFLUX_BUCKET = "analytics" + INFLUX_TOKEN = "9eMkCRwRWS7xjPR_HbF5tBffKmnyRFSup7rq41tHZLOpnBsjVtRFd-y9R_P9OCcB3kr1ftDEzxcxTehcufy1SQ==" + INFLUX_HOST = "https://europe-west1-1.gcp.cloud2.influxdata.com" + INFLUX_ORG = "9a707721bb47fc02" + class << self extend T::Sig include Context - INFLUX_BUCKET = "analytics" - INFLUX_TOKEN = "9eMkCRwRWS7xjPR_HbF5tBffKmnyRFSup7rq41tHZLOpnBsjVtRFd-y9R_P9OCcB3kr1ftDEzxcxTehcufy1SQ==" - INFLUX_HOST = "europe-west1-1.gcp.cloud2.influxdata.com" - sig { params(type: Symbol, metadata: T::Hash[Symbol, T.untyped]).void } def report_google(type, metadata = {}) analytics_ids = ENV.fetch("HOMEBREW_ANALYTICS_IDS", "").split(",") @@ -93,7 +94,7 @@ module Utils "--data-raw", "#{measurement},#{tags} count=1i #{Time.now.to_i}" ] - url = "https://#{INFLUX_HOST}/api/v2/write?bucket=#{INFLUX_BUCKET}&precision=s" + url = "#{INFLUX_HOST}/api/v2/write?bucket=#{INFLUX_BUCKET}&precision=s" deferred_curl(url, args) end