Does .net trace processing have equivalent or better event parsing support as ETW2JSON? - .net-traceprocessing

I've looked through much of the documentation on trace processing and ETW in general but still feel as though I'm lacking some specifics. Does the Trace Processing library contain support to process all events that are part of a .etl file? For instance, ETW2JSON claims to support the following and provides a library to deserialize events:
Windows MOF Classes events, Windows Vista Manifest events and EventSource .NET events. It also understands events that XPERF (WPR) adds as part of its merging process (to give PDB information) for profiler tools like the Windows Performance Recorder.
Does the Trace Processing library provide equivalent or better support for processing all types of events from a .etl file?
For instance, let's say I'm processing via generic events.
using (ITraceProcessor trace = TraceProcessor.Create(etlPath))
{
IPendingResult<IGenericEventDataSource> genericEvents = trace.UseGenericEvents();
trace.Process();
IGenericEventDataSource genericEventDataSource = genericEvents.Result;
foreach (IGenericEvent gevent in genericEventDataSource.Events)
{
// process event
}
}
With the above code, does this give me access to all events in a .etl file?

(I am a developer at Microsoft who works on the TraceProcessor project.)
I don't have experience with the ETW2JSON project, so I can't speak to comparisons.
There are four ETW provider types:
MOF/Classic - Events available in the IClassicEventDataSource
Windows Trace Preprocessor (WPP) - Events available in the IWindowsTracePreprocessorDataSource
Manifested - Events available in the IGenericEventDataSource
TraceLogging - Events available in the IGenericEventDataSource
(You can use the IsTraceLogging property on IGenericEvent to distingush between manifested and TraceLogging events.)
I don't know of a type of event in the trace that wouldn't appear in one of those three data sources, but if you find something missing, please let me know.

Related

Finding status if MDB is running

I want to use mbeans on startup of j2ee application to check if all the MDBs are running and jms specification has been activated.
Any pointers will be very helpful
The only way I know of to do this would be to use the ServerEndpointControl MBean. This is a Liberty specific MBean for controlling the input sources for work into the runtime. This can also be used to get status on http listeners.
The best place to find the Javadoc for the MBean is here. To find out if an MBean is running you call the isPaused method providing the MDB name which is defined as:
ApplicationName#ModuleName#BeanName
if the MDB is running it'll return false.

Flutter Crashlytics log caught exception

Looking for some clarification as to how one can log caught exceptions using flutter's firebase_crashlytics package.
If I understand correctly (and from running some sample code) Crashlytics.instance.log('text'); will only add logs to the next crash report, rather than send off a non-fatal issue itself.
I'm looking for functionality which is equivalent to Crashlytics.logException(e); on Android, e.g.
try {
throwException();
} catch (e) {
Crashlytics.logException(e);
}
which allows you to log caught exceptions so they appear as non-fatal issues in the Crashlytics dashboard.
Is this currently possible with flutter's firebase_crashlytics package?
Is calling Crashlytics.instance.recordError('text', StackTrace.current) the way to achieve this for now?
Many thanks!
Short answer, yes.
Crashlytics.instance.recordError() is the equivalent of Crashlytics.logException()
If you dig into the Flutter firebase_crashlytics source code, you can actually see what Android APIs are involved.
Flutter’s recordError() invokes the method Crashlytics#onError in the Android library.
And tracing Crashlytics#onError, you’ll see that it goes to Crashlytics.logException(exception);
Additional note, you’ll also notice why Crashlytics.instance.log() ”will only add logs to the next crash report”. These logs are added to a ListQueue<String> _logs which is then packaged into the next call of recordError()
A snippet of Flutter’s invocation of Crashlytics.logException():
_recordError(...) {
...
final String result = await channel
.invokeMethod<String>('Crashlytics#onError', <String, dynamic>{
'exception': "${exception.toString()}",
'context': '$context',
'information': _information,
'stackTraceElements': stackTraceElements,
'logs': _logs.toList(),
'keys': _prepareKeys(),
});
}
And some reference notes for Crashlytics.logException():
To reduce your users’ network traffic, Crashlytics batches logged
exceptions together and sends them the next time the app launches.
For any individual app session, only the most recent 8 logged
exceptions are stored.
To add to the accepted answer, Crashlytics.instance.recordError() has now been deprecated for the new method FirebaseCrashlytics.instance.recordError(exception, stack).
BONUS TIP:
I had this problem where all the logged exceptions are grouped under the same issue in Crashlytics dashboard. These might be different crashes of the same or different code components. Due to this, I had to manually go through each instance of the crash to verify.
From my own testing, I found out the grouping is based on the top-most line in the stack trace you passed into the method above. Luckily, Dart has an easy way to get the current stack trace using StackTrace.current.
So to properly group the issues: get the current stack trace at the time of the exception and pass it in FirebaseCrashlytics.instance.recordError(exception, stack).
Hope this helps someone out there, I looked everywhere on the internet for a similar issue but can't find any.

propagate OpenTracing TraceIds from publisher to consumer using MassTransit.RabbitMQ

Using MassTransit.RabbitMQ v5.3.2 and OpenTracing.Contrib.NetCore v0.5.0.
I'm able publish and consume events to RabbitMQ using MassTransit and I've got OpenTracing working with Jaeger, but I haven't managed to get my OpenTracing TraceIds propogated from my message publisher to my message consumer - The publisher and consumer traces have different TraceIds.
I've configured MassTransit with the following filter:
cfg.UseDiagnosticsActivity(new DiagnosticListener("test"));
I'm not actually sure what the listener name should be, hence "test". The documentation doesn't have an example for OpenTracing. Anyways, this adds a 'Publishing Message' span to the active trace on the publish side, and automatically sets up a 'Consuming Message' trace on the consumer side; however they're separate traces. How would I go about consolidating this into a single trace?
I could set a TraceId header using:
cfg.ConfigureSend(configurator => configurator.UseExecute(context => context.Headers.Set("TraceId", GlobalTracer.Instance.ActiveSpan.Context.TraceId)))
but then how would I configure my message consumer so that this is the root TraceId? Interested to see how I might do this, or if there's a different approach...
Thanks!
If anyone is interested; I ended up solving this by creating some publish and consume MassTransit middleware to do the trace propagation via trace injection and extraction respectively.
I've put the solution up on GitHub - https://github.com/yesmarket/MassTransit.OpenTracing
Still interested to hear if there's a better way of doing this...

QLowEnergyService never transitions to ServiceDiscovered state on custom bluetooth service

I have created a Bluetooth communicator in Qt 5.5.1 following the Qt documentation. I have gotten to the point where I am able to view a list of services offered by a Bluetooth device. The services are generated by:
QLowEnergyService *service = controller->createServiceObject(serviceUuid);
Where controller is a QLowEnergyController and serviceUuid is a QBluetoothUuid. The service is created successfully but since it is a custom service offered by the device I am trying to connect to, the name is unknown. At this point I call:
service->discoverDetails();
which transitions the service to the QLowEnergyService::DiscoveringServices state from the QLowEnergyService::DiscoveryRequired state. Once this happens, the state never changes again and no error is ever thrown. Is there a way to pull the characteristics of an "unknown service"? I have checked the Uuid against what I expected for the service and it is correct. I also have the Uuid of the expected characteristics.
Note: I am using a pyqt (Python binding library of QT C++).
I stumbled upon issue while trying to connect to some device which offers two services. One is the standard battery service and another is private custom non-standard service.
I noticed that I was able to discover the batter service successfully, but I was not able to discover that custom service. However, for some reason, when I subscribed to service_error signal, the discovery works fine, and whenever i comment it out, it does not work.
void QLowEnergyService::error(QLowEnergyService::ServiceError newError)
I know it is funny and I do not have an explanation, but it could be related and i felt it is worth sharing.
QMetaObject::invokeMethod(this, "discoverCharacteristics", Qt::QueuedConnection);
void discoverCharacteristics() {
service->discoverDetails();
}

How to open too many browsers using Selenium WebDriver?

I have a requirement to open 50 to 100 URLs once and verify the login for each URL. All URLs belongs to Same App but hosted for different customers? How I can open multiple browsers, say 20 to 50 browser with different URLs using Selenium WebDriver? I tried TestNG with Parallel attribute set to "Tests" and instantiating driver object in #BeforeTest but after opening 2 browsers getting selenium exception as browser closed or died for 3rd browser.
Below find code for this.
#Test
#Parameters({ "url" })
public void testParallel(String url) throws Exception {
try {
driver.get(url);
int i = 0;
i++;
System.out.println("Browser Count" + i);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
I think it is not possible to use multiple IEDriver instances in parallel on the same machine using Java bindings. (remember reading somewhere.. .NET bindings support parallel IE instances)
As per official documentation of IEDriver, "Unlike other WebDriver classes, there should only ever be a single InternetExplorerDriver instance at one time for some language bindings. If you need to run more than one instance of the InternetExplorerDriver at a time, consider using the RemoteWebDriver and virtual machines.". Refer here.
This should work with FirefoxDriver provided you have got your testng xml right. Or if you want it on IE, then you should consider setting up a grid and launch IE nodes on different machines, so that parallel runs can happen.
Why do you need to open them all at once? Selenium is not designed for load testing. If you want to check how your application or server is doing under load you better have a look at JMeter.
For a test like that I would recommend not using a browser per-se but instead use HTMLUnit driver (which is like a headless browser). Also, there is a thing called GhostDriver than might also accomplish similar. Still, you should probably use a remote Grid node+hub but you don't need to in order to accomplish your goal.
Selenium can do load testing in that respect. Also, I wouldh't use TestNG: instead, I would use Gradle or Maven because they have JUnit forking-multithread capability in themselves. In Gradle or Maven, create a task that filters and identifies certain test class and then forks processes to run them multi-threaded. I created an example here.

Resources