Skip to content

Commit

Permalink
Use analytics from arg file
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladislav Alekseev committed Feb 25, 2021
1 parent 946ab29 commit 07d410d
Show file tree
Hide file tree
Showing 82 changed files with 830 additions and 296 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This document has been deprecated.

All changes are now being documented via **Releases** page on GitHub.

# Change Log

All notable changes to this project will be documented in this file.
Expand Down
54 changes: 51 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ let package = Package(
"LocalHostDeterminer",
"Logging",
.product(name: "Metrics", package: "CommandLineToolkit"),
"MetricsExtensions",
"QueueModels",
"RunnerModels",
.product(name: "Statsd", package: "CommandLineToolkit"),
Expand All @@ -143,6 +144,7 @@ let package = Package(
"BuildArtifactsTestHelpers",
.product(name: "DateProvider", package: "CommandLineToolkit"),
.product(name: "DateProviderTestHelpers", package: "CommandLineToolkit"),
"MetricsExtensions",
.product(name: "MetricsTestHelpers", package: "CommandLineToolkit"),
"QueueCommunication",
"QueueCommunicationTestHelpers",
Expand Down Expand Up @@ -381,6 +383,7 @@ let package = Package(
"Logging",
"LoggingSetup",
.product(name: "Metrics", package: "CommandLineToolkit"),
"MetricsExtensions",
.product(name: "PathLib", package: "CommandLineToolkit"),
"PluginManager",
"QueueClient",
Expand Down Expand Up @@ -408,6 +411,7 @@ let package = Package(
name: "DistWorkerModels",
dependencies: [
"LoggingSetup",
"MetricsExtensions",
"QueueModels",
"RESTInterfaces",
],
Expand All @@ -418,6 +422,7 @@ let package = Package(
dependencies: [
"DistWorkerModels",
"LoggingSetup",
"MetricsExtensions",
"QueueModels",
],
path: "Tests/DistWorkerModelsTestHelpers"
Expand All @@ -435,6 +440,7 @@ let package = Package(
dependencies: [
"BuildArtifactsTestHelpers",
"DistWorker",
"MetricsExtensions",
"QueueModels",
"RequestSender",
"RunnerModels",
Expand Down Expand Up @@ -479,6 +485,7 @@ let package = Package(
"Logging",
"LoggingSetup",
.product(name: "Metrics", package: "CommandLineToolkit"),
"MetricsExtensions",
.product(name: "PathLib", package: "CommandLineToolkit"),
"PluginManager",
"PortDeterminer",
Expand Down Expand Up @@ -528,6 +535,7 @@ let package = Package(
.product(name: "FileSystem", package: "CommandLineToolkit"),
.product(name: "FileSystemTestHelpers", package: "CommandLineToolkit"),
"LoggingSetup",
"MetricsExtensions",
.product(name: "MetricsTestHelpers", package: "CommandLineToolkit"),
.product(name: "PathLib", package: "CommandLineToolkit"),
.product(name: "ProcessControllerTestHelpers", package: "CommandLineToolkit"),
Expand Down Expand Up @@ -697,6 +705,7 @@ let package = Package(
"LocalHostDeterminer",
"Logging",
"LoggingSetup",
"MetricsExtensions",
.product(name: "ProcessController", package: "CommandLineToolkit"),
"QueueCommunication",
"QueueModels",
Expand All @@ -718,6 +727,7 @@ let package = Package(
"DistDeployer",
"LocalQueueServerRunner",
"LoggingSetup",
"MetricsExtensions",
.product(name: "ProcessControllerTestHelpers", package: "CommandLineToolkit"),
"QueueCommunicationTestHelpers",
"QueueModels",
Expand Down Expand Up @@ -747,15 +757,12 @@ let package = Package(
dependencies: [
.product(name: "DateProvider", package: "CommandLineToolkit"),
.product(name: "FileSystem", package: "CommandLineToolkit"),
.product(name: "Graphite", package: "CommandLineToolkit"),
"LocalHostDeterminer",
"Logging",
.product(name: "Metrics", package: "CommandLineToolkit"),
.product(name: "PathLib", package: "CommandLineToolkit"),
"QueueModels",
"Sentry",
.product(name: "SocketModels", package: "CommandLineToolkit"),
.product(name: "Statsd", package: "CommandLineToolkit"),
.product(name: "Tmp", package: "CommandLineToolkit"),
],
path: "Sources/LoggingSetup"
Expand All @@ -768,6 +775,31 @@ let package = Package(
],
path: "Tests/LoggingTests"
),
.target(
name: "MetricsExtensions",
dependencies: [
.product(name: "AtomicModels", package: "CommandLineToolkit"),
.product(name: "Graphite", package: "CommandLineToolkit"),
.product(name: "Metrics", package: "CommandLineToolkit"),
"Sentry",
.product(name: "SocketModels", package: "CommandLineToolkit"),
.product(name: "Statsd", package: "CommandLineToolkit"),
],
path: "Sources/MetricsExtensions"
),
.testTarget(
name: "MetricsExtensionsTests",
dependencies: [
.product(name: "Graphite", package: "CommandLineToolkit"),
.product(name: "Metrics", package: "CommandLineToolkit"),
"MetricsExtensions",
"Sentry",
.product(name: "SocketModels", package: "CommandLineToolkit"),
.product(name: "Statsd", package: "CommandLineToolkit"),
.product(name: "TestHelpers", package: "CommandLineToolkit"),
],
path: "Tests/MetricsExtensionsTests"
),
.target(
name: "ObservableFileReader",
dependencies: [
Expand Down Expand Up @@ -899,6 +931,7 @@ let package = Package(
dependencies: [
"DistWorkerModels",
"DistWorkerModelsTestHelpers",
"MetricsExtensions",
"QueueClient",
"QueueModels",
"QueueModelsTestHelpers",
Expand All @@ -922,6 +955,7 @@ let package = Package(
"LocalHostDeterminer",
"Logging",
.product(name: "Metrics", package: "CommandLineToolkit"),
"MetricsExtensions",
"QueueCommunicationModels",
"QueueModels",
"RESTMethods",
Expand Down Expand Up @@ -962,6 +996,7 @@ let package = Package(
"DeployerTestHelpers",
.product(name: "Graphite", package: "CommandLineToolkit"),
.product(name: "Metrics", package: "CommandLineToolkit"),
"MetricsExtensions",
.product(name: "MetricsTestHelpers", package: "CommandLineToolkit"),
"QueueCommunication",
"QueueCommunicationTestHelpers",
Expand All @@ -980,6 +1015,7 @@ let package = Package(
dependencies: [
"BuildArtifacts",
"DeveloperDirModels",
"MetricsExtensions",
"PluginSupport",
"RunnerModels",
"SimulatorPoolModels",
Expand All @@ -995,6 +1031,7 @@ let package = Package(
"BuildArtifacts",
"BuildArtifactsTestHelpers",
"DeveloperDirModels",
"MetricsExtensions",
"PluginSupport",
"QueueModels",
"RunnerModels",
Expand Down Expand Up @@ -1032,6 +1069,7 @@ let package = Package(
"LocalHostDeterminer",
"Logging",
.product(name: "Metrics", package: "CommandLineToolkit"),
"MetricsExtensions",
"PortDeterminer",
"QueueCommunication",
"QueueModels",
Expand Down Expand Up @@ -1083,6 +1121,7 @@ let package = Package(
"DistWorkerModelsTestHelpers",
.product(name: "Graphite", package: "CommandLineToolkit"),
.product(name: "Metrics", package: "CommandLineToolkit"),
"MetricsExtensions",
.product(name: "MetricsTestHelpers", package: "CommandLineToolkit"),
"PortDeterminer",
"QueueClient",
Expand Down Expand Up @@ -1352,6 +1391,7 @@ let package = Package(
"LocalHostDeterminer",
"Logging",
.product(name: "Metrics", package: "CommandLineToolkit"),
"MetricsExtensions",
.product(name: "PathLib", package: "CommandLineToolkit"),
"PluginManager",
.product(name: "ProcessController", package: "CommandLineToolkit"),
Expand Down Expand Up @@ -1406,6 +1446,7 @@ let package = Package(
.product(name: "Graphite", package: "CommandLineToolkit"),
"Logging",
.product(name: "Metrics", package: "CommandLineToolkit"),
"MetricsExtensions",
.product(name: "MetricsTestHelpers", package: "CommandLineToolkit"),
"PluginManagerTestHelpers",
.product(name: "ProcessController", package: "CommandLineToolkit"),
Expand Down Expand Up @@ -1497,6 +1538,7 @@ let package = Package(
"LocalHostDeterminer",
"Logging",
.product(name: "Metrics", package: "CommandLineToolkit"),
"MetricsExtensions",
"PluginManager",
"PluginSupport",
.product(name: "ProcessController", package: "CommandLineToolkit"),
Expand Down Expand Up @@ -1538,6 +1580,7 @@ let package = Package(
"LocalHostDeterminer",
"Logging",
.product(name: "Metrics", package: "CommandLineToolkit"),
"MetricsExtensions",
.product(name: "PathLib", package: "CommandLineToolkit"),
.product(name: "PlistLib", package: "CommandLineToolkit"),
.product(name: "ProcessController", package: "CommandLineToolkit"),
Expand Down Expand Up @@ -1584,6 +1627,7 @@ let package = Package(
"DeveloperDirLocator",
"DeveloperDirLocatorTestHelpers",
"DeveloperDirModels",
"MetricsExtensions",
.product(name: "MetricsTestHelpers", package: "CommandLineToolkit"),
.product(name: "PathLib", package: "CommandLineToolkit"),
.product(name: "PlistLib", package: "CommandLineToolkit"),
Expand Down Expand Up @@ -1625,6 +1669,7 @@ let package = Package(
"BuildArtifacts",
"DeveloperDirModels",
"LoggingSetup",
"MetricsExtensions",
"PluginSupport",
"QueueModels",
"RunnerModels",
Expand All @@ -1640,6 +1685,7 @@ let package = Package(
"BuildArtifacts",
"BuildArtifactsTestHelpers",
"LoggingSetup",
"MetricsExtensions",
"PluginSupport",
"QueueModels",
"ResourceLocation",
Expand Down Expand Up @@ -1668,6 +1714,7 @@ let package = Package(
"LocalHostDeterminer",
"Logging",
.product(name: "Metrics", package: "CommandLineToolkit"),
"MetricsExtensions",
.product(name: "PathLib", package: "CommandLineToolkit"),
"PluginManager",
"PluginSupport",
Expand Down Expand Up @@ -1704,6 +1751,7 @@ let package = Package(
.product(name: "FileSystem", package: "CommandLineToolkit"),
.product(name: "FileSystemTestHelpers", package: "CommandLineToolkit"),
"Logging",
"MetricsExtensions",
.product(name: "MetricsTestHelpers", package: "CommandLineToolkit"),
.product(name: "PathLib", package: "CommandLineToolkit"),
"PluginManagerTestHelpers",
Expand Down
4 changes: 4 additions & 0 deletions Sources/BalancingBucketQueue/Models/JobQueue.swift
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
import BucketQueue
import Foundation
import MetricsExtensions
import QueueModels

public struct JobQueue: DefinesExecutionOrder {
public let analyticsConfiguration: AnalyticsConfiguration
public let bucketQueue: BucketQueue
public let job: Job
public let jobGroup: JobGroup
public let resultsCollector: ResultsCollector
public let persistentMetricsJobId: String

public init(
analyticsConfiguration: AnalyticsConfiguration,
bucketQueue: BucketQueue,
job: Job,
jobGroup: JobGroup,
resultsCollector: ResultsCollector,
persistentMetricsJobId: String
) {
self.analyticsConfiguration = analyticsConfiguration
self.bucketQueue = bucketQueue
self.job = job
self.jobGroup = jobGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public final class MultipleQueuesEnqueueableBucketReceptor: EnqueueableBucketRec

multipleQueuesContainer.add(
runningJobQueue: JobQueue(
analyticsConfiguration: prioritizedJob.analyticsConfiguration,
bucketQueue: bucketQueue,
job: Job(creationTime: Date(), jobId: prioritizedJob.jobId, priority: prioritizedJob.jobPriority),
jobGroup: fetchOrCreateJobGroup(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@ import DateProvider
import Foundation
import QueueModels
import Metrics
import MetricsExtensions
import LocalHostDeterminer

public final class MultipleQueuesJobManipulator: JobManipulator {
private let dateProvider: DateProvider
private let metricRecorder: MetricRecorder
private let specificMetricRecorderProvider: SpecificMetricRecorderProvider
private let multipleQueuesContainer: MultipleQueuesContainer
private let emceeVersion: Version

public init(
dateProvider: DateProvider,
metricRecorder: MetricRecorder,
specificMetricRecorderProvider: SpecificMetricRecorderProvider,
multipleQueuesContainer: MultipleQueuesContainer,
emceeVersion: Version
) {
self.dateProvider = dateProvider
self.metricRecorder = metricRecorder
self.specificMetricRecorderProvider = specificMetricRecorderProvider
self.multipleQueuesContainer = multipleQueuesContainer
self.emceeVersion = emceeVersion
}
Expand All @@ -37,8 +38,10 @@ public final class MultipleQueuesJobManipulator: JobManipulator {

for deletedJobQueue in jobQueuesToDelete {
multipleQueuesContainer.untrack(jobGroup: deletedJobQueue.jobGroup)

metricRecorder.capture(

try specificMetricRecorderProvider.specificMetricRecorder(
analyticsConfiguration: deletedJobQueue.analyticsConfiguration
).capture(
JobProcessingDurationMetric(
queueHost: LocalHostDeterminer.currentHostAddress,
version: emceeVersion,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public final class SingleBucketQueueStuckBucketsReenqueuer: StuckBucketsReenqueu
let buckets = stuckBuckets.flatMap { stuckBucket in
stuckBucket.bucket.testEntries.map { testEntry in
Bucket(
analyticsConfiguration: stuckBucket.bucket.analyticsConfiguration,
bucketId: BucketId(value: uniqueIdentifierGenerator.generate()),
buildArtifacts: stuckBucket.bucket.buildArtifacts,
developerDir: stuckBucket.bucket.developerDir,
Expand Down
Loading

0 comments on commit 07d410d

Please sign in to comment.