Skip to content

Commit

Permalink
remove trailing whitespace from uncompressed text files
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnen committed Sep 14, 2011
1 parent 96061c2 commit 691aa99
Show file tree
Hide file tree
Showing 559 changed files with 37,402 additions and 37,402 deletions.
12 changes: 6 additions & 6 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## Ubuntu
# general
apt-get install supervisor rsyslog
# development
apt-get install supervisor rsyslog
# development
apt-get install libcurl4-openssl-dev build-essential sun-java6-jdk ant python-software-properties subversion libpq-dev python-virtualenv python-dev libcrypt-ssleay-perl phpunit php5-tidy
# python apps
apt-get install python-psycopg2 python-simplejson apache2 libapache2-mod-wsgi
apt-get install python-psycopg2 python-simplejson apache2 libapache2-mod-wsgi
# PHP web app
apt-get install memcached php5-pgsql php5-curl php5-dev php-pear php5-common php5-cli php5-memcache php5 php5-gd php5-mysql php5-ldap
# hbase
Expand Down Expand Up @@ -93,7 +93,7 @@ cp scripts/config/setupdatabaseconfig.py.dist scripts/config/setupdatabaseconfig
export PYTHONPATH=.:thirdparty
export PGPASSWORD="aPassword"
psql -h localhost -U postgres -f scripts/schema/2.2/breakpad_roles.sql
psql -h localhost -U postgres breakpad -f scripts/schema/2.2/breakpad_schema.sql
psql -h localhost -U postgres breakpad -f scripts/schema/2.2/breakpad_schema.sql
cp scripts/config/createpartitionsconfig.py.dist scripts/config/createpartitionsconfig.py
python scripts/createPartitions.py

Expand Down Expand Up @@ -125,7 +125,7 @@ chkconfig socorro-crashmover on

# set up cron jobs
ln -s /data/socorro/application/scripts/crons/socorrorc /etc/socorro/
crontab /data/socorro/application/scripts/crons/example.crontab
crontab /data/socorro/application/scripts/crons/example.crontab

# Configure Apache
edit /etc/httpd/conf.d/socorro.conf
Expand Down Expand Up @@ -157,7 +157,7 @@ htpasswd -c /data/socorro/application/.htpasswd breakpad_rw
edit /data/socorro/htdocs/application/config/*.php

## Hadoop+HBase install
# install Sun Java JDK
# install Sun Java JDK
# JDK 6u16
# download appropriate package from http://www.oracle.com/technetwork/java/javase/downloads/index.html
bash jdk-6u23-linux-x64-rpm.bin
Expand Down
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Socorro
A server for collecting, processing, and displaying crash reports from
Socorro
A server for collecting, processing, and displaying crash reports from
clients using the Breakpad libraries.

https://github.com/mozilla/socorro
Expand Down
20 changes: 10 additions & 10 deletions analysis/build.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
<?xml version="1.0"?>
<project name="Mozilla Crash-Reports" default="compile" basedir=".">

<!-- Load all properties -->
<property file="${basedir}/build.properties"/>

<path id="classpath">
<pathelement location="${build.classes}"/>
<pathelement location="."/>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>

<target name="clean">
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="build"/>
</delete>
</target>

<target name="init" depends="clean">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes}"/>
<mkdir dir="${build.javadoc}"/>
<mkdir dir="${build.lib}"/>
</target>

<target name="compile-java" depends="init">
<javac encoding="${build.encoding}" srcdir="${java.src.dir}" includes="**/*.java" destdir="${build.classes}" debug="${debug}" source="${java.src.version}" optimize="${optimize}" deprecation="${deprecation}" includeAntRuntime="false">
<classpath refid="classpath"/>
Expand All @@ -35,7 +35,7 @@
<target name="ensure-class-name" unless="class">
<fail message="You must run this target with -Dclass=ClassName"/>
</target>

<target name="hadoop-jar" depends="compile">
<delete file="${build.lib}/${project.name}-job.jar"/>
<jar destfile="${build.lib}/${project.name}-job.jar">
Expand All @@ -49,13 +49,13 @@
</fileset>
</jar>
</target>

<target name="jar" depends="compile">
<jar destfile="${build.lib}/${project.name}.jar">
<fileset dir="${build.classes}"/>
</jar>
</target>

<target name="war" depends="compile" description="--> Create the WAR file">
<mkdir dir="${dist.dir}"/>
<!-- Copy Log4j config to build so it gets included in classes dir -->
Expand All @@ -69,9 +69,9 @@
<metainf dir="${webapp.metainf.dir}"/>
<lib dir="${lib.dir}"/>
<classes dir="${build.dir}/classes"/>
</war>
</war>
</target>

<target name="deploy" depends="war" description="--> Deploy the WAR file">
<copy file="${dist.dir}/${project.name}.war" todir="${tomcat.dir}/webapps" overwrite="true"/>
</target>
Expand Down
2 changes: 1 addition & 1 deletion analysis/hbase_schema
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ create 'crash_reports_index_priority_processed', {NAME => 'ids', COMPRESSION =>
create 'crash_reports_index_signature_ooid', {NAME => 'ids', COMPRESSION => 'LZO', VERSIONS => '1', TTL => '2147483647', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}
create 'crash_reports_index_submitted_time', {NAME => 'ids', COMPRESSION => 'LZO', VERSIONS => '1', TTL => '2147483647', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}
create 'crash_reports_index_unprocessed_flag', {NAME => 'ids', VERSIONS => '1', COMPRESSION => 'NONE', TTL => '2147483647', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}, {NAME => 'processor_state', COMPRESSION => 'NONE', VERSIONS => '5', TTL => '2147483647', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}
create 'metrics', {NAME => 'counters', COMPRESSION => 'LZO', VERSIONS => '1', TTL => '2147483647', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}
create 'metrics', {NAME => 'counters', COMPRESSION => 'LZO', VERSIONS => '1', TTL => '2147483647', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}
4 changes: 2 additions & 2 deletions analysis/pig/crashstats.pig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
register './akela-0.1.jar'
register './akela-0.1.jar'
register './socorro-analysis.jar'
register '/usr/lib/hbase/hbase-0.90.1-cdh3u0.jar'

Expand Down Expand Up @@ -29,4 +29,4 @@ STORE gen_oopp INTO '$start_date-$end_date-oopps' USING PigStorage();
gen_processed_map = FOREACH oopp_filtered GENERATE com.mozilla.hadoop.pig.eval.json.JsonMap(processed_json) AS processed_json_map:map[];
processed_filtered = FILTER gen_processed_map BY processed_json_map is not null;

STORE processed_filtered INTO '$start_date-$end_date-processed' USING PigStorage();
STORE processed_filtered INTO '$start_date-$end_date-processed' USING PigStorage();
4 changes: 2 additions & 2 deletions analysis/pig/dumpsizetrends.pig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
register './akela-0.1.jar'
register './akela-0.1.jar'
register './socorro-analysis.jar'
register '/usr/lib/hbase/hbase-0.90.1-cdh3u0.jar'

Expand All @@ -7,4 +7,4 @@ gen_meta_map = FOREACH raw GENERATE com.mozilla.pig.eval.json.JsonMap(meta_json)
gen_processed_map = FOREACH raw GENERATE com.mozilla.pig.eval.json.JsonMap(processed_json) AS processed_json_map:map[];

sizes = FOREACH raw GENERATE com.mozilla.pig.eval.BytesSize(raw_dump) AS raw_size:long, com.mozilla.pig.eval.BytesSize(meta_json) AS meta_size:long, com.mozilla.pig.eval.BytesSize(processed_json) AS processed_size:long;
STORE sizes INTO '$start_date-$end_date-dumpsizes' USING PigStorage();
STORE sizes INTO '$start_date-$end_date-dumpsizes' USING PigStorage();
2 changes: 1 addition & 1 deletion analysis/pig/modulelist.pig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
register './akela-0.1.jar'
register './akela-0.1.jar'
register './socorro-analysis.jar'
/* Not sure why we have to register this JAR when it's already in Pig's classpath but we do */
register '/usr/lib/hbase/hbase-0.90.1-cdh3u0.jar'
Expand Down
4 changes: 2 additions & 2 deletions analysis/pig/stack_frames.pig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
register './akela-0.1.jar'
register './akela-0.1.jar'
register './socorro-analysis.jar'
/* Not sure why we have to register this JAR when it's already in Pig's classpath but we do */
register '/usr/lib/hbase/hbase-0.90.1-cdh3u0.jar'
Expand All @@ -13,4 +13,4 @@ STORE flat_stack INTO '$start_date-$end_date-stackframes' USING PigStorage();
method_sigs = FOREACH flat_stack GENERATE $5 AS (method_sig:chararray);
grouped_sigs = GROUP method_sigs BY method_sig;
distinct_sigs = FOREACH grouped_sigs GENERATE group, COUNT(method_sigs.method_sig);
STORE distinct_sigs INTO '$start_date-$end_date-method-signatures' USING PigStorage();
STORE distinct_sigs INTO '$start_date-$end_date-method-signatures' USING PigStorage();
26 changes: 13 additions & 13 deletions analysis/src/java/com/mozilla/socorro/CorrelationReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Xavier Stevens <[email protected]>, Mozilla Corporation (original author)
*
* Alternatively, the contents of this file may be used under the terms of
Expand All @@ -44,18 +44,18 @@ public class CorrelationReport {
private String product = null;
private String productVersion = null;
private OperatingSystem os = null;

public CorrelationReport(String product, String productVersion, String os) {
this.product = product;
this.productVersion = productVersion;
this.os = new OperatingSystem(os);
}

public CorrelationReport(String product, String productVersion, String os, String signature) {
this(product, productVersion, os);
this.os.addSignature(signature, new Signature(signature));
}

public String getProduct() {
return product;
}
Expand All @@ -79,45 +79,45 @@ public OperatingSystem getOs() {
public void setOs(OperatingSystem os) {
this.os = os;
}

public void calculateModuleRatios() {
Map<String, Signature> signatures = os.getSignatures();
Map<String, Module> osModuleMap = os.getModuleCounts();
Map<String, Module> osAddonMap = os.getAddonCounts();
for (Map.Entry<String, Signature> sigEntry : signatures.entrySet()) {
Signature sig = sigEntry.getValue();

Map<String, Module> modules = sig.getModuleCounts();
for (Map.Entry<String, Module> moduleEntry : modules.entrySet()) {
Module m = moduleEntry.getValue();
float sigRatio = sig.getCount() > 0 ? (float)m.getCount() / (float)sig.getCount() : 0.0f;
int osCount = osModuleMap.get(moduleEntry.getKey()).getCount();
float osRatio = os.getCount() > 0 ? (float)osCount / (float)os.getCount() : 0.0f;

m.setSigRatio(sigRatio);
m.setOsRatio(osRatio);

modules.put(moduleEntry.getKey(), m);
}
sig.setModuleCounts(modules);

Map<String, Module> addons = sig.getAddonCounts();
for (Map.Entry<String, Module> addonEntry : addons.entrySet()) {
Module m = addonEntry.getValue();
float sigRatio = sig.getCount() > 0 ? (float)m.getCount() / (float)sig.getCount() : 0.0f;
int osCount = osAddonMap.get(addonEntry.getKey()).getCount();
float osRatio = os.getCount() > 0 ? (float)osCount / (float)os.getCount() : 0.0f;

m.setSigRatio(sigRatio);
m.setOsRatio(osRatio);

addons.put(addonEntry.getKey(), m);
}
sig.setAddonCounts(addons);

signatures.put(sigEntry.getKey(), sig);
}

os.setSignatures(signatures);
}
}
32 changes: 16 additions & 16 deletions analysis/src/java/com/mozilla/socorro/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Xavier Stevens <[email protected]>, Mozilla Corporation (original author)
*
* Alternatively, the contents of this file may be used under the terms of
Expand Down Expand Up @@ -47,47 +47,47 @@
import com.mozilla.util.MapValueComparator;

public class Module {

private String name;
private int count;
private float sigRatio = 0.0f;
private float osRatio = 0.0f;
private Map<String, Integer> versionCounts = new HashMap<String, Integer>();

public Module(String name) {
this.name = name;
}

public String getName() {
return name;
}

public int getCount() {
return count;
}

public void setCount(int count) {
this.count = count;
}

public Map<String, Integer> getVersionCounts() {
return versionCounts;
}

public List<Map.Entry<String, Integer>> getSortedVersionCounts() {
List<Map.Entry<String, Integer>> versionPairs = new ArrayList<Map.Entry<String, Integer>>(versionCounts.entrySet());
Collections.sort(versionPairs, Collections.reverseOrder(new MapValueComparator()));
Collections.sort(versionPairs, Collections.reverseOrder(new MapValueComparator()));
return versionPairs;
}

public void incrementVersionCount(String moduleVersion, int count) {
int existingCount = 0;
if (versionCounts.containsKey(moduleVersion)) {
existingCount = versionCounts.get(moduleVersion);
}
versionCounts.put(moduleVersion, existingCount + count);
}

public void setVersionCounts(Map<String, Integer> versionCounts) {
this.versionCounts = versionCounts;
}
Expand All @@ -107,16 +107,16 @@ public float getOsRatio() {
public void setOsRatio(float osRatio) {
this.osRatio = osRatio;
}

public static class ModuleComparator implements Comparator<Module> {

public int compare(Module o1, Module o2) {
float diffRatio1 = o1.getSigRatio() - o1.getOsRatio();
float diffRatio2 = o2.getSigRatio() - o2.getOsRatio();

return diffRatio1 < diffRatio2 ? -1 : diffRatio1 > diffRatio2 ? 1 : 0;
}

}

}
Loading

0 comments on commit 691aa99

Please sign in to comment.