[JAVA-821] reading profiling status disables profiling Created: 30/Apr/13 Updated: 19/Oct/16 Resolved: 01/May/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | 2.10.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kay Agahd | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
linux 64 bit with --keyfile option |
||
| Description |
|
When reading the profiling status, profiling will be disabled afterwards. Execute Java code to read out status:
or even:
When re-checking in console, profiling is OFF: |
| Comments |
| Comment by Kay Agahd [ 02/May/13 ] | |||||||||||||||||
|
Great, I found my mistake: I used a String but it needs to be something numeric! So, instead of
it has to be:
or simply with autoboxing:
Thanks Jeff! | |||||||||||||||||
| Comment by Kay Agahd [ 01/May/13 ] | |||||||||||||||||
|
Yes, I'm pretty sure that there was no other process running. | |||||||||||||||||
| Comment by Jeffrey Yemin [ 01/May/13 ] | |||||||||||||||||
|
I put it on a loop:
and it stays at 1:
Are you sure there is no other process running that is turning it off? Have you checked the server logs for a line like:
| |||||||||||||||||
| Comment by Kay Agahd [ 01/May/13 ] | |||||||||||||||||
|
Jeff, I tried already -1 as well (see my comment in the java code above) but this did not work. | |||||||||||||||||
| Comment by Jeffrey Yemin [ 01/May/13 ] | |||||||||||||||||
|
Just use -1 as the value. In my tests, this code
produces this output:
| |||||||||||||||||
| Comment by Kay Agahd [ 01/May/13 ] | |||||||||||||||||
|
When this "works as designed", how can we read the profiling status by java without altering the profiling status? | |||||||||||||||||
| Comment by Jeffrey Yemin [ 01/May/13 ] | |||||||||||||||||
|
Try this:
The profile command doesn't treat "1" or true (the default value when you use the DB.command() method that just takes the command name) the same as 1. |