服务器日志到Dojo前端,适当的数据存储方法?

时间:2012-08-07 08:18:48

标签: ajax logging dojo

早安,我目前正在构建一个工具,使用AUX和Shell脚本逐分钟地从几个不同服务器上的各种日志中删除大量数字。目前我还有一些脚本可以按分钟生成HTML文件,这样我就可以回顾并查看任何给定分钟的系统运行状况。基本上这些HTML文件被用作归档媒体,这显然很奇怪。

推进此工具我希望在DOJO平台上构建一个前端,该平台将支持从日志中收集的每个不同数据集的小部件和图形。我过去没有太多使用过DOJO,并希望有更多经验丰富的技术能够告诉我应该使用哪些存储介质来处理脚本每分钟生成的这些简单指标。我听说过JSON方法,但我不确定。

谢谢你的时间!

强尼

1 个答案:

答案 0 :(得分:0)

只是为了跟进这一点,很可能是其他用户偶然发现的。我认为JSON绝对是前进的方向。我每分钟都有一个系统可以生成如下的JSON文件。

{
"DataDTS"   : "2014.05.02-09:00",
"System"    : "Performance Test",
"SourceServer"  : "gb02qws122debx7",
"OldestData"    : "2014.05.02-09:00",

"MetricData" : {

    "FredHopper Direct" : {
        "Small" : "FH",
        "Type" : "ByMinute",
        "HeaderLevels" : 1,
        "Data": { "Failures":0, "Avg":"0.318", "Min":"0.306", "Max":"0.340" }
    },

    "Performance By Instance" : {
        "Small" : "RATE",
        "Type" : "ByMinute",
        "HeaderLevels" : 2,
        "Sections" : {
            "102.01" : { "Attributes" : ["(20)"], "Data": { "Req":"999", "Avg Resp":"0.254" } },
            "102.02" : { "Attributes" : ["(20)"], "Data": { "Req":"144", "Avg Resp":"0.376" } },
            "103.01" : { "Attributes" : ["(20)"], "Data": { "Req":"168", "Avg Resp":"0.199" } },
            "103.02" : { "Attributes" : ["(20)"], "Data": { "Req":"152", "Avg Resp":"0.283" } },
            "Unallocated" : { "Attributes": [], "Data": {"Req":"87", "Avg Resp":"0.154"} },
            "qws122" : { "Attributes": [], "Data": {"Tot Req":"460", "Rate PPS":"7.7"} }
        }
    },


    "HTML Status" : {
        "Small" : "HTML",
        "Type" : "Status",
        "HeaderLevels" : 1,
        "Data" : [
            { "Code":"200", "Req":447 },
            { "Code":"206", "Req":1 },
            { "Code":"301", "Req":7 },
            { "Code":"302", "Req":5 },
            { "Code":"TOT", "Req":460 }
        ]
    },

    "Page Breakdown" : {
        "Small" : "PB",
        "Type" : "Status",
        "HeaderLevels" : 2,
        "Sections" : {
            "Top 15 Average Response Times" : { 
                "Attributes": [],
                "Data" : [
                    { "URL":"men", "Req":1, "Avg Resp":"3.597", "Cached":"0.0%" },
                    { "URL":"jacques-vert", "Req":1, "Avg Resp":"3.335", "Cached":"0.0%" },
                    { "URL":"OrderOKView", "Req":1, "Avg Resp":"1.615", "Cached":"0.0%" },
                    { "URL":"warehouse", "Req":1, "Avg Resp":"1.050", "Cached":"0.0%" }
                ]
            },                  
            "Top 15 Requests" : {
                "Attributes": [],
                "Data" : [
                    { "URL":"Navigate", "Req":220, "Avg Resp":"0.372", "Cached":"26.4%" },
                    { "URL":"prod", "Req":42, "Avg Resp":"0.186", "Cached":"13.5%" },
                    { "URL":"sureroute-test-object.html", "Req":24, "Avg Resp":"0.001", "Cached":"0.0%" },
                    { "URL":"TopCategories1", "Req":8, "Avg Resp":"0.032", "Cached":"0.0%" }
                ]
            }
        }
    },

    "App server CPU" : {
        "Small" : "CPU",
        "Type" : "ByMinute",
        "HeaderLevels" : 2,
        "Sections" : {
            "qap302" : { "Attributes" : ["Ent:7.0", "Max:8.0", "Mem:32768MB", "Wgt:200"], "Data": { "usr%":"16.8", "iow%":"1.4", "phy":"1.8", "ent%":"25.1" } },
            "qap312" : { "Attributes" : ["Ent:7.0", "Max:8.0", "Mem:32768MB", "Wgt:200"], "Data": { "usr%":"8.1", "iow%":"0.1", "phy":"0.8", "ent%":"11.0" } }
        }
    }

}