drbd plugin: expand comments
authorTim Laszlo <Tim.Laszlo@magnetar.com>
Tue, 29 Jul 2014 13:11:30 +0000 (08:11 -0500)
committerTim Laszlo <Tim.Laszlo@magnetar.com>
Tue, 29 Jul 2014 13:11:30 +0000 (08:11 -0500)
src/drbd.c

index 2c80ca2..f410557 100644 (file)
@@ -136,18 +136,20 @@ static int drbd_read (void)
                fields_num = strsplit (buffer,
                                fields, STATIC_ARRAY_SIZE (fields));
 
-               /* ignore headers */
+               /* ignore headers (first two iterations) */
                if (fields_num < 4)
                        continue;
 
                if (isdigit(fields[0][0]))
                {
-                       /* parse the resource line */
+                       /* parse the resource line, next loop iteration
+                          will submit values for this resource */
                        resource = strtol(fields[0], NULL, 10);
                }
                else
                {
-                       /* handle stats data */
+                       /* handle stats data for the resource defined in the
+                          previous iteration */
                        drbd_submit_fields(resource, fields, fields_num);
                }
        } /* while (fgets) */