Last post Nov 12, 2014 09:08 PM by Kevin Shen - MSFT
Nov 06, 2014 03:45 AM|topolino|LINK
I would like to get in the size of messages sent by signalR to client.
How can I get it ? Perfmin gives me the number of message but not the size.
Nov 07, 2014 03:00 AM|Kevin Shen - MSFT|LINK
Based on my understanding ,your message are in string type.
so you can get the string size in your hub, when you are ready to send .
public class MyHub : Hub
public void Send(string userId, string message)
int size = System.Text.ASCIIEncoding.Unicode.GetByteCount(message);
Nov 07, 2014 06:08 AM|topolino|LINK
I want to get a metrics regarding the message size per seconde.
My hub send to all clients an object. How can get messages per sec ?
Nov 10, 2014 09:54 PM|Kevin Shen - MSFT|LINK
As far as I know,you can serialize your object ,then get the size code like below:
private int GetObjectSize(object Object)
BinaryFormatter bf = new BinaryFormatter();
MemoryStream ms = new MemoryStream();
Array = ms.ToArray();
Nov 11, 2014 03:23 AM|topolino|LINK
Great, don't you think SignalR could give us this information ?
because my project have to send at least 100 000 updates / sec, therefore this king of code is going to slow down the treatment.
Nov 11, 2014 04:14 PM|craicovik|LINK
You're sure to need 10,000 updates per second? Could you please explain a little more logic updates?
For example, a shipment of data can be sent to multiple customers who have associated with a group of a hub.
Nov 12, 2014 04:35 AM|topolino|LINK
We are no issue with that, now we can send 100 000 updates/sec to all our clients (broadcast) and we can do better.
For now I am working on message size. That's why I need to know this parameters to improve our protocol.
Nov 12, 2014 09:08 PM|Kevin Shen - MSFT|LINK
It seems that ther is no evidence prove that signalR can give the message information.
Even when you want to send message to multiple clients,but i think you can try my code above to get the message size in your hub.