Skip to content

Commit

Permalink
test5
Browse files Browse the repository at this point in the history
  • Loading branch information
area363 committed Jan 31, 2024
1 parent 169c90e commit 9830e48
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions NineChronicles.Headless/GraphTypes/RpcInformationQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,35 @@ public RpcInformationQuery(ActionEvaluationPublisher publisher)
description: "clients connected to this node grouped by Ip addresses.",
resolve: context =>
{
int minimum = context.GetArgument<int>("minimum");
var a = new List<MultiAccountInfoGraphType.MultiAccountInfo>();
var data = publisher.GetClientsByIp(minimum);
foreach (var i in data)
try
{
var b = new MultiAccountInfoGraphType.MultiAccountInfo
int minimum = context.GetArgument<int>("minimum");
var a = new List<MultiAccountInfoGraphType.MultiAccountInfo>();
var data = publisher.GetClientsByIp(minimum);
foreach (var i in data)
{
Key = i.Key.First(),
Ips = i.Key,
Agents = i.Value,
IpsCount = i.Key.Count,
AgentsCount = i.Value.Count,
};
a.Add(b);
var b = new MultiAccountInfoGraphType.MultiAccountInfo
{
Key = i.Key.First(),
Ips = i.Key,
Agents = i.Value,
IpsCount = i.Key.Count,
AgentsCount = i.Value.Count,
};
a.Add(b);
}
return a.OrderByDescending(x => x.AgentsCount);
}
return a.OrderByDescending(x => x.AgentsCount);
catch (Exception ex)
{
Log.Error(
"[AEP-ERROR] Message: {message}, StackTrace: {stacktrace}",
ex.Message,
ex.StackTrace);
}
return new List<MultiAccountInfoGraphType.MultiAccountInfo>();
});
}
}
Expand Down

0 comments on commit 9830e48

Please sign in to comment.