Skip to content

Commit

Permalink
TestData: Some simple small test data and first draft of what's new i…
Browse files Browse the repository at this point in the history
…n v8 demo dashboard (grafana#34731)

* TestData: More test data

* Added v8 demo dashboard
  • Loading branch information
torkelo authored May 26, 2021
1 parent b168223 commit 6fb0560
Show file tree
Hide file tree
Showing 9 changed files with 3,111 additions and 59 deletions.
2,841 changes: 2,841 additions & 0 deletions devenv/dev-dashboards/datasource-testdata/new_features_in_v8.json

Large diffs are not rendered by default.

19 changes: 1 addition & 18 deletions pkg/tsdb/testdatasource/csv_data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,7 @@ func TestCSVFileScenario(t *testing.T) {
}

t.Run("loadCsvFile", func(t *testing.T) {
files := []string{"population_by_state.csv", "city_stats.csv"}
for _, name := range files {
t.Run("Should load file and convert to DataFrame", func(t *testing.T) {
frame, err := p.loadCsvFile(name)
require.NoError(t, err)
require.NotNil(t, frame)

dr := &backend.DataResponse{
Frames: data.Frames{frame},
}
err = experimental.CheckGoldenDataResponse(
filepath.Join("testdata", name+".golden.txt"), dr, true,
)
require.NoError(t, err)
})
}

files = []string{"simple", "mixed"}
files := []string{"simple", "mixed"}
for _, name := range files {
t.Run("Should load CSV Text: "+name, func(t *testing.T) {
filePath := filepath.Join("testdata", name+".csv")
Expand Down
17 changes: 0 additions & 17 deletions pkg/tsdb/testdatasource/testdata/city_stats.csv.golden.txt

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ export const CSVFileEditor = ({ onChange, query }: EditorProps) => {
onChange({ ...query, csvFileName: value });
};

const files = ['population_by_state.csv', 'city_stats.csv'].map((name) => ({ label: name, value: name }));
const files = [
'population_by_state.csv',
'gdp_per_capita.csv',
'js_libraries.csv',
'browser_marketshare.csv',
].map((name) => ({ label: name, value: name }));

return (
<InlineFieldRow>
Expand Down
26 changes: 26 additions & 0 deletions public/testdata/browser_marketshare.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Browser,Market share
IE,17.5
Chrome,50.27
Firefox,16.89
Safari,9.94
Opera,1.7
Android,1.32
360 Safe Browser,0.41
Maxthon,0.25
Sony PS3,0.04
Yandex Browser,0.36
Silk,0.23
Sogou Explorer,0.23
Mozilla,0.03
Chromium,0.13
AOL,0
QQ Browser,0.14
SeaMonkey,0.02
RockMelt,0
BlackBerry,0.01
Iron,0.01
Pale Moon,0.03
Flock,0
TheWorld,0.02
UC Browser,0.08
Other,0.38
5 changes: 0 additions & 5 deletions public/testdata/city_stats.csv

This file was deleted.

230 changes: 230 additions & 0 deletions public/testdata/gdp_per_capita.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
Country,GDP Per Capita
"Qatar",103900
"Liechtenstein",89400
"Bermuda",86000
"Macau",82400
"Luxembourg",81100
"Monaco",70700
"Singapore",61400
"Jersey",57000
"Norway",55900
"Falkland Islands (Islas Malvinas)",55400
"Brunei",55300
"Isle of Man",53800
"Hong Kong",52300
"United States",50700
"United Arab Emirates",49800
"Switzerland",46200
"Guernsey",44600
"Cayman Islands",43800
"Canada",43400
"Australia",43300
"Austria",43100
"Gibraltar",43000
"Netherlands",42900
"Ireland",42600
"British Virgin Islands",42300
"Sweden",41900
"Kuwait",40500
"Iceland",39900
"Germany",39700
"Taiwan",39400
"Belgium",38500
"Denmark",38300
"New Caledonia",37700
"United Kingdom",37500
"Greenland",37400
"Andorra",37200
"Finland",37000
"Japan",36900
"San Marino",36200
"France",36100
"European Union",35100
"Saint Pierre and Miquelon",34900
"Israel",32800
"Korea, South",32800
"Bahamas, The",31900
"Saudi Arabia",31800
"Spain",31100
"Italy",30600
"Faroe Islands",30500
"New Zealand",30200
"Oman",29600
"Bahrain",29200
"Turks and Caicos Islands",29100
"Slovenia",28700
"Guam",28700
"Czech Republic",27600
"Malta",27500
"Cyprus",27500
"Equatorial Guinea",26400
"Barbados",25800
"Seychelles",25600
"Aruba",25300
"Greece",24900
"Slovakia",24600
"Portugal",23800
"Estonia",22100
"French Polynesia",22000
"Lithuania",22000
"Poland",20900
"Trinidad and Tobago",20400
"Hungary",20000
"Chile",18700
"Latvia",18600
"Argentina",18400
"Antigua and Barbuda",18300
"Croatia",18100
"Russia",18000
"Malaysia",17200
"Botswana",17100
"Gabon",16800
"Saint Kitts and Nevis",16500
"Puerto Rico",16300
"Uruguay",16200
"Lebanon",16000
"Panama",15900
"Belarus",15900
"Mauritius",15800
"Mexico",15600
"Sint Maarten",15400
"Turkey",15200
"Curacao",15000
"Bulgaria",14500
"Virgin Islands",14500
"Dominica",14400
"Kazakhstan",14100
"Grenada",13900
"Venezuela",13800
"Northern Mariana Islands",13600
"Iran",13300
"Saint Lucia",13300
"Romania",13000
"Costa Rica",12800
"Suriname",12600
"Libya",12300
"Anguilla",12200
"Brazil",12100
"Saint Vincent and the Grenadines",12000
"Montenegro",12000
"South Africa",11600
"Colombia",11000
"Peru",10900
"Macedonia",10800
"Azerbaijan",10700
"Serbia",10600
"Palau",10500
"Thailand",10300
"Ecuador",10200
"Cuba",10200
"Timor-Leste",10000
"Tunisia",9900
"Dominican Republic",9800
"Maldives",9400
"China",9300
"Jamaica",9300
"Cook Islands",9100
"Belize",8900
"Turkmenistan",8900
"Marshall Islands",8800
"Montserrat",8500
"Bosnia and Herzegovina",8400
"Albania",8200
"Guyana",8100
"American Samoa",8000
"Namibia",7900
"Saint Helena, Ascension, and Tristan da Cunha",7800
"Tonga",7700
"El Salvador",7600
"Algeria",7600
"Ukraine",7500
"Micronesia, Federated States of",7500
"Iraq",7200
"Bhutan",6800
"Egypt",6700
"Angola",6500
"Samoa",6300
"Paraguay",6200
"Sri Lanka",6200
"Kiribati",6100
"Jordan",6100
"Georgia",6000
"Swaziland",5900
"Armenia",5900
"Niue",5800
"Mongolia",5500
"Morocco",5400
"Guatemala",5300
"Bolivia",5200
"Indonesia",5100
"Syria",5100
"Nauru",5000
"Vanuatu",5000
"Fiji",4900
"Honduras",4700
"Congo, Republic of the",4700
"Philippines",4500
"Nicaragua",4500
"Cape Verde",4200
"India",3900
"Wallis and Futuna",3800
"Vietnam",3600
"Uzbekistan",3600
"Moldova",3500
"Ghana",3400
"Tuvalu",3400
"Solomon Islands",3400
"Laos",3100
"Pakistan",2900
"West Bank",2900
"Papua New Guinea",2800
"Nigeria",2800
"Djibouti",2700
"Sudan",2600
"Western Sahara",2500
"Cambodia",2400
"Kyrgyzstan",2400
"Sao Tome and Principe",2400
"Cameroon",2400
"Yemen",2300
"Tajikistan",2300
"Mauritania",2200
"Lesotho",2200
"Senegal",2100
"Bangladesh",2100
"Chad",2000
"Gambia, The",1900
"Cote d'Ivoire",1800
"Korea, North",1800
"Kenya",1800
"Zambia",1700
"Benin",1700
"Tanzania",1600
"Rwanda",1500
"Burkina Faso",1400
"Uganda",1400
"Sierra Leone",1400
"Burma",1400
"Comoros",1300
"Haiti",1300
"Nepal",1300
"Ethiopia",1200
"Guinea-Bissau",1200
"Mozambique",1200
"Guinea",1100
"Afghanistan",1100
"Mali",1100
"Togo",1100
"South Sudan",1000
"Madagascar",1000
"Tokelau",1000
"Malawi",900
"Central African Republic",800
"Niger",800
"Eritrea",800
"Liberia",700
"Burundi",600
"Zimbabwe",600
"Somalia",600
"Congo, Democratic Republic of the",400
"Kosovo",0
7 changes: 7 additions & 0 deletions public/testdata/js_libraries.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Library,Github Stars,Forks,Watchers
React.js,169000,34000,6700
Vue,184000,29100,6300
Angular,73400,19300,3200
JQuery,54900,20000,3300
Meteor,42400,5200,1700
Aurelia,11600,684,442

0 comments on commit 6fb0560

Please sign in to comment.