autofac / autofac.diagnostics.dotgraph Goto Github PK
View Code? Open in Web Editor NEWAutofac diagnostics support to enable DOT graph visualization of resolve requests.
License: MIT License
Autofac diagnostics support to enable DOT graph visualization of resolve requests.
License: MIT License
What do we think our options are, either around code changes, or documentation, for indicating diagnostics on 'disconnected' operations.
For example, with Owned instances, if I resolve a fairly simple set of dependencies 'normally':
When putting an Owned instance in the middle, I get the following graphs out (in this order):
I don't think there is anything particularly specific to the DotGraph implementation here, but I do wonder if we should figure out a way to associate the two sets of data together.
It's really difficult to (:-P) use ingenious! package Autofac.Diagnostics.DotGraph. Namely, it is hand-heavy.
See pull request.
Some of my steps have been automated (attempts to use asynchronous, parallel multi-threaded):
Autofac Analysis but I could not get it to function within the time I had.
ToDo1: Parameterize output paths, filename template
ToDo2: Remove performance test
ToDo3: Write functional test
ToDo4: Use plantUML?
ToDo5: Option to filter-out or partition Microsoft assembly-rooted diagrams?
Seems the dot diagnostic tracer is incompatible with AF8.
Autofac
8.0.0
Autofac.Diagnostics.DotGraph
1.0.0
using Autofac;
using Autofac.Diagnostics.DotGraph;
internal class Program {
public class Foo {
}
private static void Main(string[] args) {
var cb = new ContainerBuilder();
cb.RegisterType<Foo>()
.AsSelf()
.SingleInstance();
var scope = cb.Build();
var tracer = new DotDiagnosticTracer();
scope.SubscribeToDiagnostics(tracer);
var foo = scope.Resolve<Foo>(); // <--- exception here
Console.WriteLine("Hello, World!");
}
}
No exceptions ๐
Autofac.Core.DependencyResolutionException
HResult=0x80131500
Message=An exception was thrown while executing a resolve operation. See the InnerException for details.
Source=Autofac
StackTrace:
at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest& request)
at Autofac.Core.Resolving.ResolveOperation.Execute(ResolveRequest& request)
at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest& request)
at Autofac.Core.Container.ResolveComponent(ResolveRequest& request)
at Autofac.Core.Container.Autofac.IComponentContext.ResolveComponent(ResolveRequest& request)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable`1 parameters)
at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context, IEnumerable`1 parameters)
at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context)
at Program.Main(String[] args) in ....\Program.cs:line 24
This exception was originally thrown at this call stack:
Autofac.Diagnostics.DiagnosticTracerBase.Write(string, object)
Autofac.Diagnostics.DiagnosticTracerBase.System.IObserver<System.Collections.Generic.KeyValuePair<string, object>>.OnNext(System.Collections.Generic.KeyValuePair<string, object>)
System.Diagnostics.DiagnosticListener.Write(string, object)
Autofac.Diagnostics.DiagnosticSourceExtensions.OperationStart(System.Diagnostics.DiagnosticListener, Autofac.Core.Resolving.IResolveOperation, Autofac.ResolveRequest)
Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(Autofac.ResolveRequest)
Inner Exception 1:
MissingMethodException: Method not found: 'Autofac.ResolveRequest Autofac.Core.Resolving.IResolveOperation.get_InitiatingRequest()'.
Autofac: 8.0.0
Autofac.Diagnostics.DotGraph: 1.0.0
Things worked fine using AF 7.1. Also the dot diagnostics package does not have an upper version limit on its AF dependency, so did not expect things to blow with AF8.
In core Autofac, we just added a new constructor parameter to the OperationComplete
event args.
Need to update this package with the same before we release it.
Tracking issue for the release of this package when Autofac v6 is released.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.