Skip to content

Commit

Permalink
Reduce memory consumption of tst.llquantstep.d
Browse files Browse the repository at this point in the history
For log-linear aggregation, the parameters are factor, lmag, hmag,
and steps.  For each log range -- from pow(factor,mag) to
pow(factor,mag+1) -- values are quantized into steps bins.
Thus, it is sufficient for steps to divide pow(factor,lmag) even
if it does not divide pow(factor,2).  Checking this is the aim of
this test.

The test clearly checks the case where lmag>2.  At a minimum, lmag=3.
The test uses steps=pow(factor,3).

The size of the aggregation is
    ((hmag - lmag + 1) * (steps - steps / factor) * 2 + 3) * sizeof(u64)
For the test's parameters, that comes out to about 57 Kbytes, which is
relatively large.  Since the test's footprint scales as pow(factor,3),
a reduction in factor can reduce the footprint considerably.

Adjust the test's parameters to reduce the map footprint while still
testing the same objectives.  A beneficial byproduct is that a
successful run will generate (~900 lines) less output in runtest.log.

Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
euloh committed Jan 29, 2021
1 parent d53fe33 commit 6b03855
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 961 deletions.
13 changes: 5 additions & 8 deletions test/unittest/aggs/tst.llquantstep.d
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
/* @@xfail: dtv2 */

/*
* ASSERTION:
* A step value that evenly divides factor ** lmag, but not
* factor ** 2, works correctly.
* ASSERTION: A step value that evenly divides factor ** lmag,
* but not factor ** 2, works correctly.
*
* SECTION: Aggregations/Aggregations
*
*/

#pragma D option quiet

tick-1ms
{
@ = llquantize(i++, 10, 3, 6, 1000);
@ = llquantize(i++, 3, 3, 5, 27);
}

tick-1ms
/i == 15000/
/i == 1500/
{
exit(0);
}

0 comments on commit 6b03855

Please sign in to comment.