Пример #1
0
        public string Clean()
        {
            double time_cleaning = Performance.Measure(_fhirStoreAdministration.Clean) + Performance.Measure(_fhirIndex.Clean);

            string message = String.Format(
                "Database was succesfully cleaned. \nTime spent:" +
                "\nCleaning: {0}sec.",
                time_cleaning);

            return(message);
        }
Пример #2
0
        /// <summary>
        /// Reinitializes the (database of) the server to its initial state
        /// </summary>
        /// <returns></returns>
        /// <remarks>Quite a destructive operation, mostly useful in debugging situations</remarks>
        public string Initialize()
        {
            //Note: also clears the counters collection, so id generation starts anew and
            //clears all stored binaries at Amazon S3.

            double time_cleaning = Performance.Measure(_fhirStoreAdministration.Clean) + Performance.Measure(_fhirIndex.Clean);
            double time_loading  = Performance.Measure(ImportLimitedExamples);
            double time_storing  = Performance.Measure(StoreExamples);

            string message = String.Format(
                "Database was succesfully re-initialized. \nTime spent:" +
                "\nCleaning: {0}sec \nLoading examples: {1}sec, \nStoring: {2}sec",
                time_cleaning, time_loading, time_storing);

            return(message);
        }
Пример #3
0
        public string Init(string type)
        {
            type = type.ToLower();

            double time_loading = Performance.Measure(ImportLimitedExamples);

            _examples.Entry.RemoveAll(e => e.Resource.TypeName.ToLower() != type);
            double time_storing = Performance.Measure(StoreExamples);

            string message = String.Format(
                "Database was succesfully re-initialized. \nTime spent:" +
                "\nLoading {0} {1}s: {2} seconds, \nStoring: {3} seconds",
                _examples.Entry.Count(), type, time_loading, time_storing);

            return(message);
        }