.net-traceprocessing How Can WaitAnalysis Be Used? - .net-traceprocessing

In the library .net-traceprocessing is a namespace Microsoft.Windows.EventTracing.WaitAnalysis which contains many types related to Wait Analysis. How can that be used? Based on the name it sounds useful. Has anyone experience with that one and has a sample at hand?
I know that there is a WaitClassifcation Graph in WPA. Which events need to be recorded to make this one show up as graph and how useful is that one?

We'd like to make wait analysis available in our public version, but unfortunately we weren't able to do that for our first public release. As you noticed, we removed the top-level entry point but had not cleaned up other types exposed in that namespace. Apologies for the teaser; we'll remove the other remnants of wait analysis in public surface area.
It would take a bit of work to get this feature made public, but we'll put it on our backlog, and let us know if there's more interest here, and that will help raise the priority.

Historically, you needed dispatcher, latency, and disk_io (disk_io might be optional) along with the -stackwalk command for cswitch+readythread+threadcreate+profile
xperf -on disk_io+dispatcher+latency -stackwalk cswitch+readythread+threadcreate+profile
I'm surprised it's listed, I was told that feature was not for public use, but that was 4-6 years ago too.
And example full command might look like the below section;
xperf -on disk_io+dispatcher+latency -f <path to file\xperftrace.etl> -MinBuffers 256 -MaxBuffers 1024 -MaxFile 1024 -FileMode Circular -stackwalk cswitch+readythread+threadcreate+profile

Related

Static data storage on server-side

Why some data on server-side are still stored in DBC files, not in SQL-DB? In particular - spells (spells.dbc). What for?
We have a lot of bugs in spells and it's very hard to understand what's wrong with spell, but it's harder to find it spell...
Spells, Talents, achievements, etc... Are mostly found in DBC files because that is the way Blizzard did it back in the day. It's true that in 2019 this is a pretty outdated way to work indeed. Databases are getting stronger and more versatile and having hard-coded data is proving to be hard to work with. Hell, DBCs aren't really that heavy anyways and the reason why we haven't made this change yet is that... We have no other reason other than it being a task that takes a bit of time and It is monotonous to do.
We are aware that Trinity core has already made this change but they have far more contributors than we do if that serves as an excuse!
Nonetheless, this is already in our to-do list if you check the issue tracker at the main repository.
While It's true that we can't really edit DBC files because we would lose all the progress when re-extracted or lost the files, however, we can modify spells in a C++ file called SpellMgr.
There we have a function called SpellMgr::LoadDbcDataCorrections().
The main problem while doing this change is that we have to modify the core to support this change, and the function above contains a lot of corrections. Would need intense testing to make sure nothing is screwed up in the process.
In here by altering bits you can remove or add certain properties to the desired spells instead of touching the hard coded dbc files.
If you want an example, in this link, I have changed an Archimonde spell to have no cast time.
NOTE:
In this line, the commentary about damage can be miss leading but that's because I made a mistake and I haven't finished this pull request yet as of 18/04/2019.
The work has been started, notably by Kaev. I think at least 3 DBCs are now useless server side (but probably still needed client side, they are called DataBaseClient for a reason) like item.dbc.
Also, the original philosophy (for ALL cores, not just AC) was that we would not touch DBC because we don't do custom modifications, so there was no interest in having them server side.
But we wanted to change this and started to make them available directly in the DB, if you wish to help with that, it would be nice!
Why?
Because when emulation started, dbc fields were 90% unknown. So, developers created a parser for them that just required few code changes to support new fields as soon as their functionality was discovered.
Now that we've discovered 90% of required dbc fields and we've also created some great conversion tools for DBC<->SQL, it's just a matter of "effort".
SQL conversion is useful to avoid using of client data on server (you can totally overwrite them if you don't want to go against EULA) or just extends/customize them.
Here you are the issue about DBC->SQL conversion: https://github.com/azerothcore/azerothcore-wotlk/issues/584

Generating a waveform from an audio (or video) file?

I'm trying to understand how I can generate a waveform from an audio (or video) file to display to the user.
I've been googling around for quite a while now and can't determine if this is even possible in Qt without using something like FFmpeg. I've seen all of these classes: QMediaPlayer, QMediaContent, QMediaResource, QAudioProbe and experimented with the Qt Media Player Example but am just not seeing where I can access the actual audio buffer.
So I have 2 questions:
Is what I want to do even possible without 3rd party libraries?
If it is possible, can some kind soul outline what I need to read and understand in order to access the audio data
I have tried the suggestions from this question (Audio visualization with QMediaPlayer) but the result of audioProbe->setSource(player) is always false and the method processBuffer never gets called.
audioProbe = new QAudioProbe(this);
bool success = audioProbe->setSource(player);
qDebug() << success;
connect(audioProbe, SIGNAL(audioBufferProbed(QAudioBuffer)), this, SLOT(processBuffer(QAudioBuffer)));
Update: Adding some additional detail in the hope of clarifying things.
For testing/learning I am using the Media Player Example which ships with Qt, so it is set up correctly with Q_OBJECT etc.
For audio, I tested with both .mp3 and .wav files. FWIW, the player example won't play video for some reason (.mp4, .avi were tested)
The player in the code is QMediaPlayer – which inherits from QMediaObject. The example code for the Player class is here. I added my code (in original comment above) right after the player is instantiated. I also tried adding it once media is loaded.
I tried declaring my slot first as private, then as public – either way, it is never called.
Frustrating that such a simple thing is so hard.
Going the "no external library" route will likely just lead to more of a headache and more work than is necessary. The other advantage of going with an established library is you won't be bound to one file format, as not all formats store their data the same way. If the audio format is uncompressed (wav or other) you can read the header until you get to the data chunk. An answer to this question here details this in C. You should be able to get an idea for the file format from this to apply it to another language.
You will want to understand how many channels are in the wav file, bit depth, and also the sampling rate before you can do anything worthwhile with the data. All this info can be grabbed from the header.
It turns out that QAudioProbe is not supported on OSX – the platform I am working on. Took quite a while (a "Qt while. . .") to ferret that info out so I am posting it here explicitly.
See this document for full details: Qt 5.5.0 Multimedia Backends

How to create Neo4J graphs with Spring Roo?

Is thegraphpackage still available in Roo? I would like to create graphs with Neo4J but i can't find any recent documentation or examples about the feature.
No, the graph package Neo4j is not available in the current, 1.2.5, release of Roo and history informs us that any promise to restore support should be viewed skeptically
This antiquated exchange suggests, along with 3-4 others dated as recently as one year ago, that there is little ground for hope. Moreover, the GitHub activity charts (Sorry, my SO "reputation" is not adequate to post another link. You'll have to figure this one out without help.) show zero development activity related to Spring Roo during the last month. I didn't dig much deeper but the front page shows essentially no activity in the last six months. That's not a good sign. I did read that a new development partner has just signed on, so maybe things will improve. I'm very new to Roo but I'm finding bug after bug, and problem after problem, many of them outstanding, like the absence of Neo4j, for years. I really like Roo's ideas and design but I'm not sure that I'm willing to bet on its robustness let alone its longevity. I don't seem to be alone. I searched the web and asked here but can't find direct evidence (that is, code that I can examine) that it's being used on real-world projects. Folks pick it up and toy around with it. But if they write more than 40 lines or so of code they don't open their source. (Please understand that I'm no deliberate detractor; I'd be delighted to be proven wrong on this point!)
One of the saddest consequences of not having Neo4j is that one of the three existing Roo books, Getting Started with Roo, takes it on the chin beginning near the end of the first chapter. This is otherwise an outstanding book. But the absence of Neo4j kicks its ongoing-project model right upside the head. I know the labor entailed by writing a book. Josh Long must be severely disappointed.
More generally, it seems that tech authors are being implicitly encouraged to write small chunks of code that stand on their own, so that their book won't be damaged overall by one or two technological changes. Of course, readers then never get to see code of significant size. I don't have a solution to offer but I'm definitely feeling the problem.
Edited: Because at least one passerby is demonstrably incapable of understanding the implications of repeatedly broken promises to restore support for Neo4j "in the next few days" several years ago I have explicitly spelled out the fact that support is not currently available and no credible promise of soon restoration is to be found. Please note that a broken promise to restore support implies that support was not restored and subsequent promises to restore support should be treated with some degree of skepticism. So, those who suppose that this answer is "not useful" would likely benefit from the web site. readingcomprehensionconnection.com. Or perhaps the problem is one of attention deficit, which makes it difficult to read more than a few phrases before forming a necessarily hasty conclusion. In that case, one might consider cutting back on the comic books in favor of some reading material without speech balloons. I suppose that I am not alone in finding it difficult to incorporate speech balloons in my merely textual SO comments. Perhaps a future release of SO will support a communication style more familiar and therefore more to one's liking.
Demonstration that Neo4j Is Currently Absent from the Upcoming Release, 1.2.6
The method of search follows the instructions given in (Long & Mayzak, 2011), apparently by Michael Hunger of Neo Technology, Inc., the company that developed Neo4j.
/_/ |_|\____/\____/ 1.2.6.BUILD-SNAPSHOT [rev 32b413d]
Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
roo> project --topLevelPackage org.hagiasmon.gswr --projectName gswr
Created ROOT/pom.xml
Created SRC_MAIN_RESOURCES
Created SRC_MAIN_RESOURCES/log4j.properties
Created SPRING_CONFIG_ROOT
Created SPRING_CONFIG_ROOT/applicationContext.xml
roo> pgp trust -keyId 0x29c2d8fd
You must specify option 'keyId' for this command
roo> pgp trust --keyId 0x29c2d8fd
Added trust for key:
>>>> KEY ID: 0x29C2D8FD <<<<
More Info: http://keyserver.ubuntu.com/pks/lookup?fingerprint=on&op=index&search=0x29C2D8FD
Created: 2011-Jan-06 10:48:11 +0000
Fingerprint: 558eb0489fe5500c68fa8a306107f33d29c2d8fd
Algorithm: RSA_GENERAL
User ID: Michael Hunger <Michael.Hunger#jexp.de>
Signed By: Key 0x29C2D8FD (Michael Hunger <Michael.Hunger#jexp.de>)
Subkey ID: 0xDEFB5FB1 [RSA_GENERAL]
roo> addon search graph
0 found, sorted by rank; T = trusted developer; R = Roo 1.2 compatible
ID T R DESCRIPTION -------------------------------------------------------------
--------------------------------------------------------------------------------
[HINT] use 'addon info id --searchResultId ..' to see details about a search result
[HINT] use 'addon install id --searchResultId ..' to install a specific search result, or
[HINT] use 'addon install bundle --bundleSymbolicName TAB' to install a specific add-on version
roo>
P.S. I initiated Facebook correspondence with Josh Long, who along with Michael Hunger, are the two folks driving the Roo - Neo4j interface, as far as I can tell. If he responds, I'll update this comment.

Documentation Generation - What boxes should I aim to tick?

I'm looking at requiring my team to document their code more thoroughly for some major upcoming projects and to make life a little less painful, I am steering towards XML documentation generators such as Sandcastle, Doxygen or Box Live Documenter.
What are the key considerations I should keep in mind when evaluating the best option and what experiences have led you to a particular decision?
For me the key considerations would be:
Fully automated: Can it be set up in such a way so that pretty much
no outside work is required to
create or edit the documentation.
Fully styled: Can the documentation be fully styled so
that it looks great in a wiki or pdf
after it’s generated. I should be
able to change colors, font sizes,
layouts, etc.
Good Filtering: Can I select only the items I want to be
generated. I should be able to
filter the namespaces, file types,
classes, etc.
Customization: Can I include headers, footers, custom elements,
etc.
I found Doxygen could do all of this. Our workflow is as follows:
Developer makes a change to the code
They update the documentation tags right above the code they just changed
We click a generate button
Doxygen will then extract all the XML documentation from the code, filter it to only include the classes and methods we want, and apply the CSS styling we’ve pre-made for it. Our end result is an internal wiki that looks the way we want, and doesn’t require editing.
Extra: We have all our projects in various git repositories. We pull all these down to one root folder and generate the docs form this root folder..
Would be interested to know how others are automating even further..?
Who is paying for the documentation and why? (is the system stable enough, does it add enough value)
Who is going to read it, and why is she not using a more effective communication channel?
(if correct mostly distance in time/place)
Who is going to keep it up to date.
When are you going to destroy it? (Automatically if it hasn't been read or updated in the past three months?)
I mostly prefer better code to make my life less painful, over more documentation, but I like scenario & unit tests and a high level architecture description.
[edit] Documentation costs time and money to write and keep up to date. JavaDoc style documentation has a serious detrimental effect on the amount of code simultaneously visible and might be a good idea for the developers using the code, but not for those writing it.

Documentation of the lesser know AS3 properties

Over the past three weeks, I have lost at least 120 man hours because of some lesser known functionality in ActionScript 3. One of the problems was that, with Internet Explorer, if there are too many messages sent through LocalConnections, it will slow the messages sent through, but in the standalone player and in Firefox, this threshold is significantly higher. Another was that the static values of a class are instantiated even if the member itself is not being used:
import path.to.FooClass;
private function thisIsNeverCalledButItEnsuresThatFooClassIsImported():void
{
var f:FooClass = new FooClass();
}
Since FooClass had a static reference to a Singleton, that Singleton was instantiated so when I loaded a Module which used that Singleton, it would bind to values in an unpredictable way.
Additional cases where things behave in an unexpected way:
MovieClip.addFrameScript
flash.trace.Trace as a class
int is a faster incrementer class, Number is faster for mathematics, and uint is incredibly slow.
PrintDataGrid, if it has only one page, needs to have an empty value appended to the end of its dataProvider
If you use try...catch around two LocalConnections and connect them to the same channel, you will force garbage collection without needing System.gc
So here's the question (and I'm sorry for omitting this in the original post), is there any consolidated documentation for this type of behavior anywhere? Is there any (even non-Adobe) documentation on these issues (websites, forums, books, ANYTHING)? I know that these things are definitely easy enough TO document, but has anyone done so?
If not, am I missing anything? Are there other issues which I should know about?
This kind of useful information is very often not "centralized". Moreover, what you are looking for is something related to the experience of the programmer (more than to official docs).
FYI, there are two other methods for ensuring a class is included.
#1 - This syntax is actually used in the Flex source code:
import path.to.FooClass; FooClass; // note double reference
public class References
{
// No references needed in this class
}
#2 - Use the includes command line argument
-includes path.to.FooClass
You can always submit your experience using the "feedback" section in the help. Unfortunately, this is less obvious than the link that used to be at the bottom of each page in the older help files (which also served the useful function of opening a browser window with the web version of that help page).
Adobe says that it incorporates the comments from previous versions of the help into new versions, but my own observation suggests that there are instances where it does not happen. However, that and the appropriate cookbook are still the best avenue for those who believe that this kind of information should be centralized.
Note that the whole purpose behind modules is to avoid compiling code multiple times, so importing FooClass kind of defeated the purpose. The problems you had in this instance are just one of the many that happen if you use Singletons, and it's unfortunate that the first official Framework, Cairngorm, encouraged their widespread use. Check out http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/ .

Resources