public static PerformanceSampler ForInstance(string instanceName) { if (samplers.ContainsKey(instanceName)) { return samplers[instanceName]; } lock (samplers) { if (samplers.ContainsKey(instanceName)) { return samplers[instanceName]; } samplers[instanceName] = new PerformanceSampler(instanceName); return samplers[instanceName]; } }
public static PerformanceSampler ForInstance(string instanceName) { if (samplers.ContainsKey(instanceName)) { return(samplers[instanceName]); } lock (samplers) { if (samplers.ContainsKey(instanceName)) { return(samplers[instanceName]); } samplers[instanceName] = new PerformanceSampler(instanceName); return(samplers[instanceName]); } }