From d003cdd7cbd9876089f5b6ee10f0c8308cd16bb7 Mon Sep 17 00:00:00 2001 From: isc-tleavitt <73311181+isc-tleavitt@users.noreply.github.com> Date: Wed, 22 Oct 2025 15:20:04 -0400 Subject: [PATCH] fix: missing table stats make performance awful? --- CHANGELOG.md | 27 ++++++++++++++++----------- cls/TestCoverage/Data/Run.cls | 6 ++++++ module.xml | 2 +- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e458d4..7af7dae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [4.0.8] - Unreleased + +### Fixed +- #70: Performance regression on newer IRIS versions when table stats are missing on a clean instance/run + ## [4.0.7] - 2025-09-23 ### Fixed @@ -18,33 +23,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [4.0.5] - 2024-11-04 -### Fixed +### Fixed - #57: Improve SQL performance when mapping run coverage ## [4.0.4] - 2024-10-15 -### Fixed +### Fixed - #54: Defend against possible configuration-dependent SQL exceptions in mapping INT to MAC/CLS coverage ## [4.0.3] - 2024-08-19 -### Fixed -- #52: Method mapping code now doesn't use AST's endline_no property to support older python versions +### Fixed +- #52: Method mapping code now doesn't use AST's endline_no property to support older python versions - #53: Ignore traced commands from code without a class name ## [4.0.2] - 2024-08-16 ### Fixed -- #51: Don't start (and stop) the ObjectScript and Python monitors if there are no ObjectScript/Python routines being tracked respectively, fixes error from trying to start/stop the %Monitor.System.LineByLine with no routines +- #51: Don't start (and stop) the ObjectScript and Python monitors if there are no ObjectScript/Python routines being tracked respectively, fixes error from trying to start/stop the %Monitor.System.LineByLine with no routines ## [4.0.1] - 2024-08-16 -### Fixed -- #45: Fixed Python line 0 tracking for 2024.2 +### Fixed +- #45: Fixed Python line 0 tracking for 2024.2 - #46: Fix for bug caused by UpdateComplexity calling GetCurrentByName unnecessarily and causing dependency issues - #47: Fixed mapping issue caused by empty lines at top of Python method not showing up in compiled Python -- #48: When the Line-By-Line Monitor resumes after pausing, resume the Python tracer too +- #48: When the Line-By-Line Monitor resumes after pausing, resume the Python tracer too - #49: Added user parameter for preloading python modules (fixes problem of pandas breaking sys.settrace on first import) ## [4.0.0] - 2024-08-01 @@ -52,14 +57,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - #29: As a consequence of this change, the minimum supported platform version is 2022.1 -### Added +### Added - #29: Track code coverage for embedded python methods in .cls files -- #42: Added a listener interface and manager with an associated user parameter, allowing the user to broadcast output on test method/case/suite completion. +- #42: Added a listener interface and manager with an associated user parameter, allowing the user to broadcast output on test method/case/suite completion. ## [3.1.1] - 2024-07-31 ### Fixed -- #39: Fixed bug where results viewer gave divide by zero error when there were 0 executed methods in the covered code +- #39: Fixed bug where results viewer gave divide by zero error when there were 0 executed methods in the covered code - #41: Now the code strips leading and trailing whitespace from coverage.list, so "PackageName.PKG " will still be loaded properly ## [3.1.0] - 2024-07-05 diff --git a/cls/TestCoverage/Data/Run.cls b/cls/TestCoverage/Data/Run.cls index 1e7332f..e1d5d9b 100644 --- a/cls/TestCoverage/Data/Run.cls +++ b/cls/TestCoverage/Data/Run.cls @@ -35,6 +35,10 @@ ClassMethod MapRunCoverage(pRunIndex As %Integer) As %Status Try { Set tRun = ##class(TestCoverage.Data.Run).%OpenId(pRunIndex,,.tSC) $$$ThrowOnError(tSC) + + do $SYSTEM.SQL.Stats.Table.GatherSchemaStats("TestCoverage_Data","TuneLog.txt") + do $SYSTEM.SQL.Stats.Table.GatherSchemaStats("TestCoverage_Data_Aggregate","TuneLog.txt") + do $SYSTEM.SQL.Stats.Table.GatherSchemaStats("TestCoverage_Data_CodeSubUnit","TuneLog.txt") // It would be wonderful if there was support for something along the lines of (with a few made up non-functions): /* @@ -117,6 +121,8 @@ ClassMethod MapRunCoverage(pRunIndex As %Integer) As %Status Set tCoverage.CoveredLines = $BitLogic(tCoverage.CoveredLines|hCoveredLines) $$$ThrowOnError(tCoverage.%Save()) } + + do $SYSTEM.SQL.Stats.Table.GatherTableStats("TestCoverage_Data.Coverage","TuneLog.txt") // Copy any other metrics captured/requested as well. For i=1:1:tRun.Metrics.Count() { diff --git a/module.xml b/module.xml index 94ead62..27f6299 100644 --- a/module.xml +++ b/module.xml @@ -2,7 +2,7 @@ TestCoverage - 4.0.7 + 4.0.8 Run your typical ObjectScript %UnitTest tests and see which lines of your code are executed. Includes Cobertura-style reporting for use in continuous integration tools. module