2008-03-05 09:52:00 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Microsoft Research Singularity
|
|
|
|
//
|
|
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
//
|
|
|
|
// Note: Contract definition for the Singularity Channel diagnostics service
|
|
|
|
//
|
|
|
|
|
|
|
|
using Microsoft.Singularity.Directory;
|
|
|
|
using Microsoft.Singularity.Channels;
|
|
|
|
|
|
|
|
namespace Microsoft.Singularity.Diagnostics.Contracts
|
|
|
|
{
|
|
|
|
public rep struct ChannelInfo {
|
|
|
|
public int ChannelId;
|
|
|
|
public int ImpProcessId;
|
|
|
|
public int ExpProcessId;
|
|
|
|
public int MessagesDeliveredToImp;
|
|
|
|
public int MessagesDeliveredToExp;
|
|
|
|
}
|
|
|
|
|
|
|
|
public contract ChannelContract : ServiceContract
|
|
|
|
{
|
2008-11-17 18:29:00 -05:00
|
|
|
public const string ModuleName = "/status/channels";
|
2008-03-05 09:52:00 -05:00
|
|
|
|
|
|
|
// Signal our identity
|
|
|
|
out message Ready();
|
|
|
|
|
|
|
|
in message GetChannels();
|
|
|
|
out message Channels(ChannelInfo[]! in ExHeap channels);
|
|
|
|
|
|
|
|
in message GetChannelStats();
|
|
|
|
out message ChannelStats(long msgsSent, long bytesSent, long channelsCreated);
|
|
|
|
|
|
|
|
override state Start : one
|
|
|
|
{
|
|
|
|
Ready! -> ReadyState;
|
|
|
|
}
|
|
|
|
|
|
|
|
state ReadyState : one
|
|
|
|
{
|
|
|
|
GetChannels? -> Channels! -> ReadyState;
|
|
|
|
GetChannelStats? -> ChannelStats! -> ReadyState;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|