Ejemplo n.º 1
0
        private static void GrainReport(string[] args)
        {
            var grainId = ConstructGrainId(args, "GrainReport");

            var silos = GetSiloAddresses().GetResult();

            if (silos == null || silos.Count == 0)
            {
                return;
            }

            var reports = new List <DetailedGrainReport>();

            foreach (var silo in silos)
            {
                WriteStatus(string.Format("**Calling GetDetailedGrainReport({0}, {1})", silo, grainId));
                try
                {
                    var siloControl = client.GetSystemTarget <ISiloControl>(Constants.SiloControlId, silo);
                    DetailedGrainReport grainReport = siloControl.GetDetailedGrainReport(grainId).Result;
                    reports.Add(grainReport);
                }
                catch (Exception exc)
                {
                    WriteStatus(string.Format("**Failed to get grain report from silo {0}. Exc: {1}", silo, exc.ToString()));
                }
            }
            foreach (var grainReport in reports)
            {
                WriteStatus(grainReport.ToString());
            }

            LookupGrain(args);
        }
Ejemplo n.º 2
0
 static int CountActivations(DetailedGrainReport report) => report.LocalActivation is
 {