[Groonga-commit] groonga/groonga at 8c8fc41 [master] munin: use parenthesis for all puts

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Dec 26 15:26:33 JST 2013


Kouhei Sutou	2013-12-26 15:26:33 +0900 (Thu, 26 Dec 2013)

  New Revision: 8c8fc41a6b5235a3eb734c5e7c1747cf4d1f808f
  https://github.com/groonga/groonga/commit/8c8fc41a6b5235a3eb734c5e7c1747cf4d1f808f

  Message:
    munin: use parenthesis for all puts
    
    Because some puts()s uses parenthesis and all exit()s uses
    parenthesis.

  Modified files:
    data/munin/groonga_cpu_time
    data/munin/groonga_disk
    data/munin/groonga_n_records
    data/munin/groonga_query_performance
    data/munin/groonga_status
    data/munin/groonga_throughput

  Modified: data/munin/groonga_cpu_time (+8 -8)
===================================================================
--- data/munin/groonga_cpu_time    2013-12-26 15:16:10 +0900 (e38e30e)
+++ data/munin/groonga_cpu_time    2013-12-26 15:26:33 +0900 (bd75134)
@@ -11,13 +11,13 @@ command = ARGV.shift
 case command
 when "autoconf", "detect"
   if pid_file.nil?
-    puts "no (PID file isn't specified by env.pid_file)"
+    puts("no (PID file isn't specified by env.pid_file)")
     exit(false)
   elsif File.exist?(pid_file)
-    puts "yes"
+    puts("yes")
     exit(true)
   else
-    puts "no (PID file doesn't exist: #{pid_file})"
+    puts("no (PID file doesn't exist: #{pid_file})")
     exit(false)
   end
 when "config"
@@ -26,7 +26,7 @@ when "config"
   else
     title = "groonga: CPU time"
   end
-  puts <<EOF
+  puts(<<EOF)
 graph_title #{title}
 graph_vlabel CPU time (days)
 graph_category groonga
@@ -37,8 +37,8 @@ cpu_time.type GAUGE
 EOF
   exit(true)
 when "suggest"
-  puts "gqtp"
-  puts "http"
+  puts("gqtp")
+  puts("http")
   exit(true)
 end
 
@@ -54,8 +54,8 @@ if /\A(?:(\d+)-)?(\d+):(\d+):(\d+)\z/ =~ time
   day_in_seconds = 60 * 60 * 24
   fraction_in_day = time_in_seconds.to_f / day_in_seconds.to_f
   cpu_time_in_day = day + fraction_in_day
-  puts "cpu_time.value #{cpu_time_in_day}"
+  puts("cpu_time.value #{cpu_time_in_day}")
 else
-  puts "invalid time format: <#{time}>"
+  puts("invalid time format: <#{time}>")
   exit(false)
 end

  Modified: data/munin/groonga_disk (+12 -12)
===================================================================
--- data/munin/groonga_disk    2013-12-26 15:16:10 +0900 (492207b)
+++ data/munin/groonga_disk    2013-12-26 15:26:33 +0900 (0e97343)
@@ -57,7 +57,7 @@ def schema
   tables = []
   success, table_list_body = run("table_list")
   unless success
-    puts "error: #{table_list_body}"
+    puts("error: #{table_list_body}")
     exit(false)
   end
   parse_list(table_list_body[0], table_list_body[1..-1]).each do |table|
@@ -65,7 +65,7 @@ def schema
     table["key"] = "table_#{table_name}"
     success, column_list_body = run("column_list", table_name)
     unless success
-      puts "error: #{column_list_body}"
+      puts("error: #{column_list_body}")
       exit(false)
     end
     table["columns"] = parse_list(column_list_body[0], column_list_body[1..-1])
@@ -104,10 +104,10 @@ case command
 when "autoconf", "detect"
   success, body = run("status")
   if success
-    puts "yes"
+    puts("yes")
     exit(true)
   else
-    puts "no (#{body})"
+    puts("no (#{body})")
     exit(false)
   end
 when "config"
@@ -116,7 +116,7 @@ when "config"
   else
     title = "groonga: #{label}: disk usage"
   end
-  puts <<EOF
+  puts(<<EOF)
 graph_title #{title}
 graph_vlabel Bytes
 graph_category groonga
@@ -130,7 +130,7 @@ EOF
   schema.each do |table|
     table_key = table["key"]
     table_name = table["name"]
-    puts <<EOF
+    puts(<<EOF)
 
 #{table_key}.label #{table_name}
 #{table_key}.draw STACK
@@ -138,7 +138,7 @@ EOF
     table["columns"].each do |column|
       column_key = column["key"]
       column_name = column["full_name"]
-      puts <<EOF
+      puts(<<EOF)
 
 #{column_key}.label #{column_name}
 #{column_key}.draw STACK
@@ -147,8 +147,8 @@ EOF
   end
   exit(true)
 when "suggest"
-  puts "gqtp"
-  puts "http"
+  puts("gqtp")
+  puts("http")
   exit(true)
 end
 
@@ -160,20 +160,20 @@ unless $?.success?
 end
 usages = parse_du_result(du_result)
 usage = compute_size(usages, @path)
-puts <<EOF
+puts(<<EOF)
 database.value #{usage}
 EOF
 schema.each do |table|
   table_key = table["key"]
   table_name = table["name"]
   usage = compute_size(usages, table["path"])
-  puts <<EOF
+  puts(<<EOF)
 #{table_key}.value #{usage}
 EOF
   table["columns"].each do |column|
     column_key = column["key"]
     usage = compute_size(usages, column["path"])
-    puts <<EOF
+    puts(<<EOF)
 #{column_key}.value #{usage}
 EOF
   end

  Modified: data/munin/groonga_n_records (+8 -8)
===================================================================
--- data/munin/groonga_n_records    2013-12-26 15:16:10 +0900 (46614e5)
+++ data/munin/groonga_n_records    2013-12-26 15:26:33 +0900 (f0e3c56)
@@ -62,7 +62,7 @@ end
 def table_list
   success, body = run("table_list")
   unless success
-    puts "error: #{body}"
+    puts("error: #{body}")
     exit(false)
   end
   tables = parse_list(body[0], body[1..-1])
@@ -76,10 +76,10 @@ case command
 when "autoconf", "detect"
   success, body = run("status")
   if success
-    puts "yes"
+    puts("yes")
     exit(true)
   else
-    puts "no (#{body})"
+    puts("no (#{body})")
     exit(false)
   end
 when "config"
@@ -88,7 +88,7 @@ when "config"
   else
     title = "groonga: #{label}: number of records"
   end
-  puts <<EOF
+  puts(<<EOF)
 graph_title #{title}
 graph_vlabel records
 graph_category groonga
@@ -96,7 +96,7 @@ graph_info number of records in groonga table
 EOF
   table_list.each do |table|
     name = table["name"]
-    puts <<EOF
+    puts(<<EOF)
 
 #{name}.label #{name}
 #{name}.type GAUGE
@@ -104,8 +104,8 @@ EOF
   end
   exit(true)
 when "suggest"
-  puts "gqtp"
-  puts "http"
+  puts("gqtp")
+  puts("http")
   exit(true)
 end
 
@@ -117,7 +117,7 @@ table_list.each do |table|
     exit(false)
   end
   n_records = body[0][0][0]
-  puts <<EOF
+  puts(<<EOF)
 #{name}.value #{n_records}
 EOF
 end

  Modified: data/munin/groonga_query_performance (+9 -9)
===================================================================
--- data/munin/groonga_query_performance    2013-12-26 15:16:10 +0900 (17299f7)
+++ data/munin/groonga_query_performance    2013-12-26 15:26:33 +0900 (e0de5b0)
@@ -15,14 +15,14 @@ command = ARGV.shift
 case command
 when "autoconf", "detect"
   if @log_path.nil?
-    puts "no (query log file path isn't specified by env.log_path)"
+    puts("no (query log file path isn't specified by env.log_path)")
     exit(false)
   end
   unless File.readable?(@log_path)
-    puts "no (query log file isn't readable: <#{@log_path}>)"
+    puts("no (query log file isn't readable: <#{@log_path}>)")
     exit(false)
   end
-  puts "yes"
+  puts("yes")
   exit(true)
 when "config"
   if label.nil?
@@ -30,7 +30,7 @@ when "config"
   else
     title = "groonga: #{label}: query performance"
   end
-  puts <<EOF
+  puts(<<EOF)
 graph_title #{title}
 graph_vlabel seconds
 graph_category groonga
@@ -42,8 +42,8 @@ median.label Median
 EOF
   exit(true)
 when "suggest"
-  puts "gqtp"
-  puts "http"
+  puts("gqtp")
+  puts("http")
   exit(true)
 end
 
@@ -132,6 +132,6 @@ else
   median = sorted_elapsed_times[sorted_elapsed_times.size / 2]
 end
 
-puts "longest.value #{longest}"
-puts "average.value #{average}"
-puts "median.value #{median}"
+puts("longest.value #{longest}")
+puts("average.value #{average}")
+puts("median.value #{median}")

  Modified: data/munin/groonga_status (+6 -6)
===================================================================
--- data/munin/groonga_status    2013-12-26 15:16:10 +0900 (fa3d09b)
+++ data/munin/groonga_status    2013-12-26 15:26:33 +0900 (79a43ab)
@@ -65,10 +65,10 @@ case command
 when "autoconf", "detect"
   success, body = run("status")
   if success
-    puts "yes"
+    puts("yes")
     exit(true)
   else
-    puts "no (#{body})"
+    puts("no (#{body})")
     exit(false)
   end
 when "config"
@@ -77,7 +77,7 @@ when "config"
   else
     title = "groonga: #{label}: status"
   end
-  puts <<EOF
+  puts(<<EOF)
 graph_title #{title}
 graph_vlabel status
 graph_category groonga
@@ -88,8 +88,8 @@ alloc_count.type GAUGE
 EOF
   exit(true)
 when "suggest"
-  puts "gqtp"
-  puts "http"
+  puts("gqtp")
+  puts("http")
   exit(true)
 end
 
@@ -98,6 +98,6 @@ unless success
   puts("error: #{body}")
   exit(false)
 end
-puts <<EOF
+puts(<<EOF)
 alloc_count.value #{body["alloc_count"]}
 EOF

  Modified: data/munin/groonga_throughput (+6 -6)
===================================================================
--- data/munin/groonga_throughput    2013-12-26 15:16:10 +0900 (55d922a)
+++ data/munin/groonga_throughput    2013-12-26 15:26:33 +0900 (ba0c2e1)
@@ -74,10 +74,10 @@ case command
 when "autoconf", "detect"
   success, body = run("status")
   if success
-    puts "yes"
+    puts("yes")
     exit(true)
   else
-    puts "no (#{body})"
+    puts("no (#{body})")
     exit(false)
   end
 when "config"
@@ -86,7 +86,7 @@ when "config"
   else
     title = "groonga: #{label}: throughput"
   end
-  puts <<EOF
+  puts(<<EOF)
 graph_title #{title}
 graph_vlabel queries per ${graph_period}
 graph_category groonga
@@ -97,8 +97,8 @@ n_queries.type COUNTER
 EOF
   exit(true)
 when "suggest"
-  puts "gqtp"
-  puts "http"
+  puts("gqtp")
+  puts("http")
   exit(true)
 end
 
@@ -107,6 +107,6 @@ unless success
   puts("error: #{body}")
   exit(false)
 end
-puts <<EOF
+puts(<<EOF)
 n_queries.value #{body["n_queries"]}
 EOF
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index