buildgrid 0.3.2__py3-none-any.whl → 0.3.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1907,6 +1907,7 @@ class Scheduler:
1907
1907
 
1908
1908
  def _publish_job_duration(
1909
1909
  self,
1910
+ instance_name: str,
1910
1911
  start: Timestamp | None,
1911
1912
  end: Timestamp | None,
1912
1913
  state: str,
@@ -1920,6 +1921,7 @@ class Scheduler:
1920
1921
  publish_timer_metric(
1921
1922
  METRIC.JOB.DURATION,
1922
1923
  end.ToDatetime() - start.ToDatetime(), # type: ignore[union-attr]
1924
+ instanceName=instance_name,
1923
1925
  state=state,
1924
1926
  propertyLabel=property_label,
1925
1927
  schedulerName=assigner_name or "none",
@@ -1965,6 +1967,7 @@ class Scheduler:
1965
1967
  now_timestamp = Timestamp()
1966
1968
  now_timestamp.FromDatetime(datetime.utcnow())
1967
1969
  self._publish_job_duration(
1970
+ next_job.instance_name,
1968
1971
  start_timestamp,
1969
1972
  now_timestamp,
1970
1973
  "Queued",
@@ -2227,6 +2230,7 @@ class Scheduler:
2227
2230
  now_timestamp = Timestamp()
2228
2231
  now_timestamp.FromDatetime(datetime.utcnow())
2229
2232
  self._publish_job_duration(
2233
+ job.instance_name,
2230
2234
  start_timestamp,
2231
2235
  now_timestamp,
2232
2236
  "Queued",
@@ -2527,7 +2531,12 @@ class Scheduler:
2527
2531
  )
2528
2532
  )
2529
2533
  self._publish_execution_stats(
2530
- session, job.name, action_result.execution_metadata, job.property_label, job.assigner_name
2534
+ session,
2535
+ job.name,
2536
+ job.instance_name,
2537
+ action_result.execution_metadata,
2538
+ job.property_label,
2539
+ job.assigner_name,
2531
2540
  )
2532
2541
 
2533
2542
  def get_bot_status_metrics(self) -> BotMetrics:
@@ -2684,17 +2693,21 @@ class Scheduler:
2684
2693
  def publish_execution_stats(
2685
2694
  self,
2686
2695
  job_name: str,
2696
+ instance_name: str,
2687
2697
  execution_metadata: ExecutedActionMetadata,
2688
2698
  property_label: str = "unknown",
2689
2699
  assigner_name: str | None = None,
2690
2700
  ) -> None:
2691
2701
  with self._sql_ro.session(expire_on_commit=False) as session:
2692
- self._publish_execution_stats(session, job_name, execution_metadata, property_label, assigner_name)
2702
+ self._publish_execution_stats(
2703
+ session, job_name, instance_name, execution_metadata, property_label, assigner_name
2704
+ )
2693
2705
 
2694
2706
  def _publish_execution_stats(
2695
2707
  self,
2696
2708
  session: Session,
2697
2709
  job_name: str,
2710
+ instance_name: str,
2698
2711
  execution_metadata: ExecutedActionMetadata,
2699
2712
  property_label: str,
2700
2713
  assigner_name: str | None,
@@ -2710,12 +2723,18 @@ class Scheduler:
2710
2723
  upload_start = execution_metadata.output_upload_start_timestamp
2711
2724
  upload_completed = execution_metadata.output_upload_completed_timestamp
2712
2725
 
2713
- self._publish_job_duration(queued, worker_completed, "Total", property_label, assigner_name)
2726
+ self._publish_job_duration(instance_name, queued, worker_completed, "Total", property_label, assigner_name)
2714
2727
  # The Queued time is missing here as it's posted as soon as worker has accepted the job.
2715
- self._publish_job_duration(worker_start, worker_completed, "Worker", property_label, assigner_name)
2716
- self._publish_job_duration(fetch_start, fetch_completed, "Fetch", property_label, assigner_name)
2717
- self._publish_job_duration(execution_start, execution_completed, "Execution", property_label, assigner_name)
2718
- self._publish_job_duration(upload_start, upload_completed, "Upload", property_label, assigner_name)
2728
+ self._publish_job_duration(
2729
+ instance_name, worker_start, worker_completed, "Worker", property_label, assigner_name
2730
+ )
2731
+ self._publish_job_duration(instance_name, fetch_start, fetch_completed, "Fetch", property_label, assigner_name)
2732
+ self._publish_job_duration(
2733
+ instance_name, execution_start, execution_completed, "Execution", property_label, assigner_name
2734
+ )
2735
+ self._publish_job_duration(
2736
+ instance_name, upload_start, upload_completed, "Upload", property_label, assigner_name
2737
+ )
2719
2738
 
2720
2739
  if self.metering_client is None or len(execution_metadata.auxiliary_metadata) == 0:
2721
2740
  return
@@ -13,4 +13,4 @@
13
13
  # limitations under the License.
14
14
 
15
15
 
16
- __version__ = "0.3.2"
16
+ __version__ = "0.3.3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: buildgrid
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Summary: A remote execution service
5
5
  License: Apache License, Version 2.0
6
6
  Project-URL: Homepage, https://buildgrid.build
@@ -208,7 +208,7 @@ buildgrid/server/servicer.py,sha256=oqU9MaSxxHTDmSxobFTo9YmJctaUCklE2Dj-vfYWKkc,
208
208
  buildgrid/server/settings.py,sha256=I1UK-g4_GwkX0nGC3hdGS3Cc0Rh1HTYDv2aHU2sq_eU,5604
209
209
  buildgrid/server/threading.py,sha256=4QKQYev2KoO2Q-S_OyaoR9qpWyDTVzGMWVe9o2a1yIU,4743
210
210
  buildgrid/server/types.py,sha256=xG3bx64pbWMuEwXLuI0o8c2unt2rU2C4zsmUfmMT12c,1323
211
- buildgrid/server/version.py,sha256=9hszMRmtGUkZbKKAfeEActwnrXaZkxNudCeHQb8v_8o,603
211
+ buildgrid/server/version.py,sha256=ZFnZSeeeNvUxJJyB2m9gdtWL-3UIBuVI7L2U-mwR2NU,603
212
212
  buildgrid/server/actioncache/__init__.py,sha256=g9lb8Sn7NY5KOjkMr9GQoJovCVDEg_Fxz_EhdDbhP1I,579
213
213
  buildgrid/server/actioncache/instance.py,sha256=UCR7ZGkv4fJOXjeIILMAdTSFWcGgBSYlBg8fMaPJpaI,3139
214
214
  buildgrid/server/actioncache/service.py,sha256=WcikJAzFYOYX-tgiOfGGcOnPoubrCd4yP-EhKCHEW0c,2021
@@ -331,7 +331,7 @@ buildgrid/server/scheduler/__init__.py,sha256=arCg8LWFATeX1tj-s0keVYP8p3wwrrUlCV
331
331
  buildgrid/server/scheduler/assigner.py,sha256=wHPAhyiQxYABZJXaUc2g5yFzM78Z0U5nvGV3X9h5pCM,10512
332
332
  buildgrid/server/scheduler/cohorts.py,sha256=L_5YZRiVOwPPGStfqnnQXknO5Ja-SC0vq0xjw4XgP-I,1426
333
333
  buildgrid/server/scheduler/events.py,sha256=cM7Z7Htr2pYKhltJxfg1YRo0q524yZaGm8yXvRehivk,1453
334
- buildgrid/server/scheduler/impl.py,sha256=NsZwiSQcQAdWgqh-Y6G0BPhtwJgbEbBa8UnmllsyFWE,135759
334
+ buildgrid/server/scheduler/impl.py,sha256=BT5JIdh7B6-pw1OHxnhJjZgQ1sM3T1UxakXoc6ppBxs,136236
335
335
  buildgrid/server/scheduler/notifier.py,sha256=22ZsKwyf2oQirAjrwROkvgvr4C_TMUNyhOmtro4uM4I,7121
336
336
  buildgrid/server/scheduler/properties.py,sha256=2GydX8KUy9MFv1_JznIkGfWE_wOS0m_XapSv6Gp4pCM,11260
337
337
  buildgrid/server/sql/__init__.py,sha256=zbeeRP9BEeDzR-Mx2Ip6SUr49J8eeXsuREgljJTrHkk,579
@@ -366,9 +366,9 @@ buildgrid/server/utils/async_lru_cache.py,sha256=iLKeRPoZtZb1wC5AtcyQm8Wt0Bx-KZm
366
366
  buildgrid/server/utils/bots.py,sha256=c8hn7tbCecru-m2wicRmtKU5v5rSZPGlk97Yc6eUHgQ,1729
367
367
  buildgrid/server/utils/cancellation.py,sha256=pNETzKNoXg0AsXOXKCcLWlFl7SVKdkKinlqWl7MesRA,1703
368
368
  buildgrid/server/utils/digests.py,sha256=YNrWeHdbNp7OVTcsInjs30C33z_t9GQ_noMd14bpqPQ,2424
369
- buildgrid-0.3.2.dist-info/licenses/LICENSE,sha256=swa3Vs7GgALaG9p-e05M-WLkhd_U9QknacNkyVZ85xA,11338
370
- buildgrid-0.3.2.dist-info/METADATA,sha256=ZbSgvpI9ItnWHDwTIWVew6XYP-4OnV42Y9NFBo9slhE,7086
371
- buildgrid-0.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
372
- buildgrid-0.3.2.dist-info/entry_points.txt,sha256=uyFAXiR9d6EDfSA5vWT8xskz6xalt4PdTuRruT6Q8rk,49
373
- buildgrid-0.3.2.dist-info/top_level.txt,sha256=T6TYhI_k6NTm2871tIxGCyBIqzlKxylgF9KDLU0Hi7o,10
374
- buildgrid-0.3.2.dist-info/RECORD,,
369
+ buildgrid-0.3.3.dist-info/licenses/LICENSE,sha256=swa3Vs7GgALaG9p-e05M-WLkhd_U9QknacNkyVZ85xA,11338
370
+ buildgrid-0.3.3.dist-info/METADATA,sha256=dshu6eNHOz_JPLV3tM3gGitvI9BaGiWpgTWvv2sqjb0,7086
371
+ buildgrid-0.3.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
372
+ buildgrid-0.3.3.dist-info/entry_points.txt,sha256=uyFAXiR9d6EDfSA5vWT8xskz6xalt4PdTuRruT6Q8rk,49
373
+ buildgrid-0.3.3.dist-info/top_level.txt,sha256=T6TYhI_k6NTm2871tIxGCyBIqzlKxylgF9KDLU0Hi7o,10
374
+ buildgrid-0.3.3.dist-info/RECORD,,