Best way to view server CCU count?

What's the most convenient way I can view the CCU count of self-hosted server, without having to log into the game myself?

On Photon Cloud I can simply open up my dashboard and it will tell me, but this is not an option with self-hosted.

I tried to dig into Photon Counters, and to publish to AWS CloudWatch from an EC2 instance, but honestly the documentation on it is nigh on unpenetrable.

Sorry for being an idiot

Comments

  • Hi, @OldPilgrim
    in order to use AWS counters you have to get extra assemblies. did you get them?

    best,
    ilya
  • OldPilgrim
    edited July 2020
    Hi @chvetsov , thanks for your reply. Does this mean there is no other way to read server CCU apart from Photon Counters?

    Anyway, regarding the extra assemblies, you are talking about https://github.com/PhotonEngine/photon.counterpublisher.cloudwatch ? Yes I have obtained them.
    However, I haven't gotten round to them yet, because I cannot even install the counters right now on EC2, get following error:

    Capture.png

    Edit: ok so I solved this problem by manually creating the folder specified in the error dialog. Will update on my progress...
  • Alright, so now I'm getting this error:
    2020-07-28 10:56:52,003 [1] ERROR Photon.SocketServer.ApplicationBase - System.IO.FileNotFoundException: Could not load file or assembly 'AWSSDK.CloudWatch, Version=3.3.0.0, Culture=neutral, PublicKeyToken=*redacted*' or one of its dependencies. The system cannot find the file specified.
    File name: 'AWSSDK.CloudWatch, Version=3.3.0.0, Culture=neutral, PublicKeyToken=*redacted*'
       at ExitGames.Diagnostics.Monitoring.Protocol.AWS.CloudWatch.AWSCloudWatchWriter.Start(CounterSampleSenderBase sender)
       at ExitGames.Diagnostics.Monitoring.CounterSampleSenderBase.Start() in c:\(Work)\(EG)\exitgames-libs\src\Core\Diagnostics\Monitoring\CounterSampleSenderBase.cs:line 199
       at Photon.SocketServer.Diagnostics.CounterPublisher.Start() in h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\Diagnostics\CounterPublisher.cs:line 240
       at Photon.SocketServer.ApplicationBase.PhotonHostRuntimeInterfaces.IPhotonControl.OnPhotonRunning() in h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\ApplicationBase.cs:line 1173
    
    Seems like I need to bring in the AWS SDK, which wasn't included in the repo? Let's see where this leads...
  • OldPilgrim
    edited July 2020
    Ok. So the problem is that in the CounterPublisher.AWS.CloudWatch.csproj file, the post build event is trying to copy AWSSDK.dll, which actually doesn't exist. I've fixed it to copy AWSSDK.CloudWatch.dll instead. I can make a pull request to your repo if you guys want.

    Edit: I can report that ExitGames/PhotonServer is now appearing under CloudWatch metrics. However, the photon service takes a really long time to start up (> 5 mins), whereas it only took a few seconds before. Is this normal behaviour?

    Also, it seems I am only getting like two data points on CloudWatch, despiting sitting in front of the computer for a while...
  • >Edit: I can report that ExitGames/PhotonServer is now appearing under CloudWatch metrics. However, the photon service takes a really long time to start up (> 5 mins), whereas it only took a few seconds before. Is this normal behaviour?

    what do you see in logs?

    >Also, it seems I am only getting like two data points on CloudWatch, despiting sitting in front of the computer for a while...

    not sure what does this mean

    best,
    ilya
  • OldPilgrim
    edited July 2020
    @chvetsov nothing came up in logs, but the startup problem went away after I restarted the EC2 instance...
    not sure what does this mean

    Yeah never mind, it works, I didn't know how to read the CloudWatch graphs lol

    I have one more question - right now the CounterPublisher publishes everything including the System metrics. I only want to publish the peer count. How can I do that?

    I tried setting addDefaultAppCounter="false" in the config file, but everything is still being added. Also, I couldn't work out the correct format for the schemas,
          <Counters>
            <Schema namespace="TestNamespace" type="Photon.CounterPublisher.SystemCounter, CounterPublisher" />
          </Counters>
    

    Why is it TestNameSpace??

    I tried the following but the type couldn't be parsed (thrown exception in logs):
    <Counters>
    	<Schema namespace="Photon.CounterPublisher" type="SocketServerCounter.Peers, CounterPublisher" />
    </Counters>
    

    Thanks for your patience and help.

    Edit: FYI I am using the plugins SDK.
  • hi, @OldPilgrim

    name space here is namespace for your counters. In the end you will get TestNamespace.Peers or something like this. It can be empty.

    It is not possible to filter counters from configuration. All what is registered is sent

    best,
    ilya
  • Ok, I went into the source code and manually registered the peer counter myself. Thanks!
  • that is great

    best,
    ilya
  • Hi, I'm trying to expose the Photon server v5 metrics (e.g. peer count) on AWS CloudWatch. But from the 5.0 RC log, it seems CounterPublisher(discussed in this thread) has been officially deprecated. And I couldn't find any alternatives on v5 documentation page either.

    What would be the recommendation for CounterPublisher alternatives in server v5? Thanks.
  • Update: I was able to plot the metrics on CloudWatch via Windows PerfLog + CloudWatch agent, which seems to be a reasonable alternative. Thanks.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @zedwei,

    Thank you for choosing Photon!

    Thanks for the update.
    It's indeed a nice alternative, we will probably consider this option when customers will ask for such thing and we may add it to the documentation.