** Returns a map of all services defined by this IoC.constmixin ServiceStats {** Returns service stats, keyed by service idabstract Str:ServiceStat stats()}internalconstclass ServiceStatsImpl : ServiceStats {privateconst RegistryImpl registrynew make(RegistryImpl registry){this.registry = registry}override Str:ServiceStat stats(){ registry.stats}}** Defines some statistics for a serviceconstclass ServiceStat {const Str serviceIdconst Type typeconst ServiceScope scopeconst ServiceLifecycle lifecycleconst Int noOfImplsinternalnew make(|This|? f){ f?.call(this)}internal This withLifecyle(ServiceLifecycle newLifecycle){if(newLifecycle.ordinal <= lifecycle.ordinal)returnthisreturn ServiceStat {it.serviceId = this.serviceIdit.type = this.typeit.scope = this.scopeit.lifecycle = newLifecycleit.noOfImpls = this.noOfImpls}}internal This withNoOfImpls(Int newNoOfImpls){ ServiceStat {it.serviceId = this.serviceIdit.type = this.typeit.scope = this.scopeit.lifecycle = this.lifecycleit.noOfImpls = newNoOfImpls}}}** Defines the lifecycle state of a serviceenum class ServiceLifecycle {** The service is defined in a module, but has not yet been referenced. DEFINED,// Not yet!// ** A proxy has been created for the service, but no methods of the proxy have been invoked.// VIRTUAL,** A service implementation for the service has been created. CREATED,** Builtin services exist before the `Registry` is constructed. BUILTIN;}