Esempio n. 1
0
 private static void AppendNewlineToStringBuilder(StringBuilder stringBuilder)
 {
     IndexMetricWriter.AppendHeaderToStringBuilder(
         stringBuilder,
         string.Empty,
         indentLevel: 0);
 }
Esempio n. 2
0
 protected void WriteBeforeIndexUtilizationInfo()
 {
     IndexMetricWriter.AppendNewlineToStringBuilder(this.stringBuilder);
     IndexMetricWriter.AppendHeaderToStringBuilder(
         this.stringBuilder,
         IndexMetricWriter.IndexUtilizationInfo,
         indentLevel: 0);
 }
Esempio n. 3
0
        protected void WriteIndexUtilizationInfo(IndexUtilizationInfo indexUtilizationInfo)
        {
            IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricWriter.UtilizedSingleIndexes, indentLevel: 1);

            foreach (SingleIndexUtilizationEntity indexUtilizationEntity in indexUtilizationInfo.UtilizedSingleIndexes)
            {
                WriteSingleIndexUtilizationEntity(indexUtilizationEntity);
            }

            IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricWriter.PotentialSingleIndexes, indentLevel: 1);

            foreach (SingleIndexUtilizationEntity indexUtilizationEntity in indexUtilizationInfo.PotentialSingleIndexes)
            {
                WriteSingleIndexUtilizationEntity(indexUtilizationEntity);
            }

            IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricWriter.UtilizedCompositeIndexes, indentLevel: 1);

            foreach (CompositeIndexUtilizationEntity indexUtilizationEntity in indexUtilizationInfo.UtilizedCompositeIndexes)
            {
                WriteCompositeIndexUtilizationEntity(indexUtilizationEntity);
            }

            IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricWriter.PotentialCompositeIndexes, indentLevel: 1);

            foreach (CompositeIndexUtilizationEntity indexUtilizationEntity in indexUtilizationInfo.PotentialCompositeIndexes)
            {
                WriteCompositeIndexUtilizationEntity(indexUtilizationEntity);
            }

            void WriteSingleIndexUtilizationEntity(SingleIndexUtilizationEntity indexUtilizationEntity)
            {
                IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, $"{IndexMetricWriter.IndexExpression}: {indexUtilizationEntity.IndexDocumentExpression}", indentLevel: 2);
                IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, $"{IndexMetricWriter.IndexImpactScore}: {indexUtilizationEntity.IndexImpactScore}", indentLevel: 2);
                IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricWriter.IndexUtilizationSeparator, indentLevel: 2);
            }

            void WriteCompositeIndexUtilizationEntity(CompositeIndexUtilizationEntity indexUtilizationEntity)
            {
                IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, $"{IndexMetricWriter.IndexExpression}: {String.Join(", ", indexUtilizationEntity.IndexDocumentExpressions)}", indentLevel: 2);
                IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, $"{IndexMetricWriter.IndexImpactScore}: {indexUtilizationEntity.IndexImpactScore}", indentLevel: 2);
                IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricWriter.IndexUtilizationSeparator, indentLevel: 2);
            }
        }