cysharp / dframe Goto Github PK
View Code? Open in Web Editor NEWDistributed load testing framework for .NET and Unity.
License: MIT License
Distributed load testing framework for .NET and Unity.
License: MIT License
If a project using DFrame references MagicOnion 6.1.3, an error occurs during project execution.
The error message is as follows:
fail: DFrame.DFrameWorkerEngine[0]
Failed on worker executing.
System.TypeLoadException: Could not load type 'MagicOnion.Serialization.MessagePackMagicOnionSerializerProvider' from assembly 'MagicOnion.Shared, Version=6.1.3.0, Culture=neutral, PublicKeyToken=7bf5b512f16761c0'.
at DFrame.DFrameWorkerEngine.ConnectAsync(CancellationToken applicationLifeTime)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at DFrame.DFrameWorkerEngine.ConnectAsync(CancellationToken applicationLifeTime)
at DFrame.DFrameWorkerEngine.RunAsync(CancellationToken applicationLifeTime)
I have an idea that might make the parameters a bit clearer and would like to hear your thoughts on it.
When an ID is taken as an argument, it would be nice to be able to specify the name that corresponds to that ID.
We assume that the name can be selected from a drop-down list on the web page.
We assume a case where a file is read and parsed when the worker starts.
From the `DFrameWorkloadTypeInfo' it looked like it could be done.
For example
[AttributeUsage(AttributeTargets.Parameter)]
public class EnumerationAttribute : Attribute
{
public string EnumerationFunctionName { get; }
public EnumerationAttribute(string enumerationFunctionName) => EnumerationFunctionName = enumerationFunctionName;
}
record Data(int Id, string Name, int SomeData);
class DataLoader
{
public Dictionary<int, Data> Data { get; } = new();
public Task LoadAsync() => Task.CompletedTask;
}
class SomeWorklaod : Workload
{
public static DataLoader DataLoader { get; set; } = default!;
private static IEnumerable<(string name, int value)> EnumerationSomeValues() => DataLoader.Data.Select(x => (x.Value.Name, x.Key));
public SomeWorklaod([Enumeration(nameof(EnumerationSomeValues))] int someValue) { }
public override Task ExecuteAsync(WorkloadContext context) => Task.CompletedTask;
}
I haven't come up with a good concrete way to deal with this, but I think if you put a value like $"{Name}:{Value}"
in WorkloadParameterInfo.EnumNames
, you can return it to a value in CrateArgument
.
What is not good about this is that there is no freedom in how the DataLoader is held.
I think there is something else that might be a better idea.
This one is simpler, I want to put a DisplayAttribute
on the enum so that I can use its name.
For example
enum SomeEnum
{
[Display(Name = "Test parameter 1")] Type1,
[Display(Name = "Test parameter 2")] Type2,
[Display(Name = "Test parameter 3")] Type3,
}
class SomeWorkload : Workload
{
public SomeWorkload(SomeEnum someValue) { }
public override Task ExecuteAsync(WorkloadContext context) => Task.CompletedTask;
}
It would be nice if this could also be compounded with $"{Name}:{Value}"
.
I wrote constructor overload.
public enum ServerType
{
A,
B,
}
public class MultiConstructorWorkload : Workload
{
private static string GetUrl(ServerType t) => "";
public MultiConstructorWorkload(ServerType t) : this(GetUrl(t)) { }
public MultiConstructorWorkload(string url) { }
public override Task ExecuteAsync(WorkloadContext context) => Task.CompletedTask;
}
A project using DFrame references MagicOnion 5.0.2 or later, an error occurs on project execution.
This appears to be caused by a breaking changes in MagicOnion 5.0.2 .
Error message is as follows.
System.MissingMethodException: Method not found: 'Grpc.Core.AsyncDuplexStreamingCall`2<Byte[],Byte[]> MagicOnion.DuplexStreamingResult`2.get_RawStreamingCall()'.
Container base image: mcr.microsoft.com/dotnet/aspnet:7.0
DFrame: 1.0.7
MagicOnion 5.0.2
Grpc.Core.Api: 2.35.0
Grpc.Net.Client: 2.34.0
I use nullable enum type.
public enum WorkerType
{
A,
B,
}
public class NullableWorkload : Workload
{
public NullableWorkload(WorkerType? t) { }
public override Task ExecuteAsync(WorkloadContext context) => Task.CompletedTask;
}
public class NotNullableWorkload : Workload
{
public NotNullableWorkload(WorkerType t) { }
public override Task ExecuteAsync(WorkloadContext context) => Task.CompletedTask;
}
But, Only null
in dropdown list.
I hope null
, A
, B
in dropdown list.
Hi there,
can you please provide an example for a 1-to-1 comparison with Locust?
Like let's say we wanted to use Number of users (peak concurrency)
10
and Spawn rate (users started/second)
10
for Run time
30s
in Locust. What values would this correspond to in DFrame and what would my ConfigureWorker
look like?
We're trying to compare the two and possibly have an alternative to Locust that supports C#.
Thanks in advance!
I need unique index per execution.
Like "Counter" in jMeter.
There is user data prepared in Database.
A unique index is needed for each execution to determine which user data should be used at this time.
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.