Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27693

dbcommands to access ftdc archive files

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Diagnostics
    • None
    • Query Optimization
    • Fully Compatible

      Hi,

      As there are these data files full of useful information in the diagnostic.data, it would be nice to have a way built in the server to use them somehow.

      I wrote a simple interface utilizing two commands:

      getDiagnosticDataFiles
      set1:PRIMARY> db.adminCommand({"getDiagnosticDataFiles":1})
      {
      	"data" : [
      		"metrics.2017-01-14T18-40-10Z-00000",
      		"metrics.2017-01-15T13-52-41Z-00000",
      		"metrics.interim"
      	],
      	"ok" : 1
      }
      set1:PRIMARY> 
      

      To list the available files and

      getDiagnosticDataFromFile
      set1:PRIMARY> db.adminCommand({"getDiagnosticDataFromFile":1,
      limit:0,
      skip:0,
      showOutput:false,
      startDate: ISODate("2017-01-11T10:02:00.024Z"),
      endDate: ISODate("2017-01-11T11:02:29.024Z"), 
      filename:"metrics.2017-01-11T09-02-29Z-00000"})
      {
      	"numDocumentsRead" : 54151,
      	"numDocumentsMatched" : 3629,
      	"data" : [ ],
      	"startDateFilter" : ISODate("2017-01-11T10:02:00.024Z"),
      	"endDateFilter" : ISODate("2017-01-11T11:02:29.024Z"),
      	"skip" : NumberLong(0),
      	"limit" : NumberLong(0),
      	"ok" : 1
      }
      

      to read the content of a file with the parameters:

      • filename : actually the filename of the archive we would like to handle
      • skip, limit : skip and limit, skip defults to 0 limit default is 100
      • showOutput: turn off data output generation to check filesize in records for example. (see the limitation described later)
      • startDate: start date of data output generation default: 1970. január 1. 00:00:00
      • endDate: end date of data output generation default DATENOW

      Will create shortly a pull request, and would kindly ask for your suggestions, what to change in the implementation. I reused the getDiagnosticData commands structure, together with the ftdc_test implementation to list the directory content, and to parse the ftdc archive file.

      The output generation has the generic 64MB limitation, which is somewhere around 600-700 documents/ftdc entries.

      The interface is compatible with the 3.2 version of the diagnostic files aswell.

      Best,
      Attila

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            atozser Attila Tozser
            Votes:
            1 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated: