public static Task<long[]> Counts( this IEventActivity instance, string eventName, DateTime startTimestamp, DateTime endTimestamp) { if (instance == null) { throw new ArgumentNullException("instance"); } return instance.Counts( eventName, startTimestamp, endTimestamp, instance.Settings.Drilldown); }
public static async Task<long> Count( this IEventActivity instance, string eventName, DateTime startTimestamp, DateTime endTimestamp, ActivityDrilldown drilldown) { if (instance == null) { throw new ArgumentNullException("instance"); } var result = await instance.Counts( eventName, startTimestamp, endTimestamp, drilldown); return result.First(); }
public static bool IsSubsetOf(this string s, string other) { if (s.Length > other.Length) return false; foreach (char c in other) { if (other.Contains(c.ToString()) == false) return false; } Dictionary<char, uint> countsS = s.Counts(); Dictionary<char, uint> countsOther = other.Counts(); foreach (KeyValuePair<char,uint> p in countsS) { if ((countsOther.ContainsKey(p.Key) && countsOther[p.Key] >= p.Value)) continue; else return false; } return true; }