Comments (8)
[author="joachimhskeie", created="Wed, 4 Aug 2010 15:42:10 +0200"]
I am unable to make the BTrace compiler accept the varargs parameters like:
printAggregation(String stringFormat, Aggregation ... aggregationArray)
I am able to make this work with a single Aggregation, but with multiple aggregations the BTrace Compiler states that only methods for BTraceUtils might be used.
Is this a shortcoming of the BTrace Compiler class ?
from btrace.
[author="joachimhskeie", created="Thu, 5 Aug 2010 22:37:44 +0200"]
I found the culprit in the VerifierVisitor class. I added a bit of code that makes the compiler compile the class when the method in BTraceUtils is a varargs method. However, this would need some type checking.
Actually, looking at the code, I would assume it safer if all parameter types were checked, and not just a check to see if the method invoked has the same amount of parameters
from btrace.
[author="joachimhskeie", created="Thu, 5 Aug 2010 23:37:34 +0200"]
I was unable to the the varargs method to work at all (the JVM translates the varargs arguments to an Array, which causes the Verifier to think that the BTrace Script is creating a new Array.
I have instead opted to implement this functionality using the Collections that were available in BTraceUtils already.
I think this is a better option than the CountingAverage approach as this makes it possible to combine any Aggregation, as long as it has the same AggregationKey.
I am attaching a diff new diff file which implements this functionality as well.
I am using the Aggregation in a script as follows:
@OnTimer(7500) public static void printAverage() { Deque aggregationDeque = newDeque(); addLast(aggregationDeque, AVERAGE); addLast(aggregationDeque, CALLS_PER_INTERVAL);<span class="code-object">String</span> execStringFormat = strcat(<span class="code-quote">"[AverageExecTime;"</span>, property(<span class="code-quote">"btrace.agentname"</span>)); Aggregations.printAggregation(<span class="code-quote">"", strcat(execStringFormat, "</span>;%1$s;%2$s;%3$d;%4$s;%5$s;%6$s;Custom]"), aggregationDeque); truncateAggregation(AVERAGE, 0); truncateAggregation(CALLS_PER_INTERVAL, 0); }
I'll leave it up to you to decide which option you like best, but I quite like the last solution best.
from btrace.
[author="jbachorik", created="Mon, 9 Aug 2010 11:01:15 +0200"]
The enhanced version of printAggregation() method sounds good.
Go ahead and push the changes. Please, make sure all the newly added public methods are properly documented and don't forget to add the @SInCE tag (for version 1.2)
from btrace.
[author="jbachorik", created="Fri, 13 Aug 2010 09:54:35 +0200"]
Will you be able to push the changes soon? If not I might apply the changes for you.
I want to start preparations for 1.2 release and I need to have all issues targeted for 1.2 resolved.
from btrace.
[author="joachimhskeie", created="Fri, 13 Aug 2010 10:30:45 +0200"]
I will push the changes over the weekend.
from btrace.
[author="joachimhskeie", created="Mon, 23 Aug 2010 22:33:54 +0200"]
Sorry for the late push! I have pushed the changes now. I chose not to push the CountingAverage Aggregation, as its probably redundant with the ability to combine aggregations into a single print.
from btrace.
[author="joachimhskeie", created="Mon, 23 Aug 2010 22:34:27 +0200"]
Changing Fix Version to 1.2 as per comments from JB.
from btrace.
Related Issues (20)
- Throw NoSuchFieldException when call getInt() method HOT 5
- btrace INFO: Attaching BTrace to PID: 3866 Broken pipe HOT 1
- Does the BTrace agent support java 17? HOT 1
- Unsupported class file major version 29281 HOT 5
- Is adding method printStrings with a ... array possible? HOT 4
- Javaagent args for output directory seems wrong HOT 3
- Btrace doesn't trace methods when trusted is true HOT 1
- Adding XStream to the dependencies error HOT 2
- JAR artifacts are shadowed with the version number
- [BTRACE WARN] Class verification failed:
- Windows batch scripts do not work properly HOT 2
- Build fails with missing artifact HOT 4
- NoClassDefFoundError for NonBlockingIdentityHashMap when running an application with BTrace HOT 4
- Review target compileJava15Java in btrace-runtime/build.gradle
- NoClassDefFoundError for ConcurrentAutoTable and others when running an application with BTrace HOT 1
- VerifyError: Bad type on operand stack HOT 2
- MT-safety of HistoOnEvent example HOT 5
- The gradle-wrapper.jar is stale with respect to gradle version. HOT 1
- Does the BTrace agent support java 21? HOT 3
- Clarify the versions of java which Btrace can target HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from btrace.