summaryrefslogtreecommitdiffstats
path: root/db
AgeCommit message (Expand)Author
2013-09-12#342 implement exportBernhard Posselt
2013-09-07extra work for postgres, fix #338Bernhard Posselt
2013-09-07quickfix releaseBernhard Posselt
2013-09-05trying to fix delete older than threshold queryBernhard Posselt
2013-09-04fix limit calculation for deleteReadOlderThanThresholdbastei
2013-08-26change email adress in copyright headersBernhard Posselt
2013-08-14also allow magnet urls in article links, fix #313Bernhard Posselt
2013-08-06move sanitation of urls to the serverside code to also provide security for c...Bernhard Posselt
2013-08-06strip all html tags from author and title, fix #287Bernhard Posselt
2013-07-01Modified readAll, readFolder and readFeed SQL queriesbluehaze
2013-06-22also set last modified when marking feeds, folders, or all read, fix #256Bernhard Posselt
2013-06-01also consider deleted folders and feeds in the feed update, #214Bernhard Posselt
2013-05-24fixed a bug when deleting foldersBernhard Posselt
2013-05-24fix a bug that would not display items of feeds without foldersBernhard Posselt
2013-05-24Fix bug that would still show items after its feed or folder has been marked ...Bernhard Posselt
2013-05-24dont use table in subselect of mark read query to not fail on mysql, fixes #173Bernhard Posselt
2013-05-21When creating a feed or folder the it should purge the deletedBernhard Posselt
2013-05-18Fix #174s17t.net
2013-05-10use a deleted flag for deleted feeds to handle undoBernhard Posselt
2013-05-09only make one request for mark all read and mark folder read, fix #171, fix a...Bernhard Posselt
2013-05-02added toAPI methods for folder and feedBernhard Posselt
2013-05-02add serialize method for apiBernhard Posselt
2013-04-29go back to order by id, fix #138, use a newest item id to prevent marking ite...Bernhard Posselt
2013-04-26order by pubdate on the client side fix #115Bernhard Posselt
2013-04-26use last_modified column for finding new items (so we also see if they were u...Bernhard Posselt
2013-04-25fix broken sql statement fix #122Bernhard Posselt
2013-04-20set autopurge limit to 200 and purge per feed rather than per user or per all...Bernhard Posselt
2013-04-19added a way to prevent feed from being updatedBernhard Posselt
2013-04-16fix bug that prevented marking read if the highestitemid was 0Bernhard Posselt
2013-04-16dont care if starred items are read or unread, always show themBernhard Posselt
2013-04-16dont show unread count when it is 0, dont bold read feeds, implemented autopa...Bernhard Posselt
2013-04-12implement mark as read for feeds and folders, fix #29Bernhard Posselt
2013-04-08add link to feed which gets opened when clicked on the subheading of an itemBernhard Posselt
2013-04-06typo fixBernhard Posselt
2013-04-06added warnings for future devs to not run into sql injection mistakesBernhard Posselt
2013-04-05fix statusflag db query bugs and unittestsBernhard Posselt
2013-04-05making shit work since 1988Bernhard Posselt
2013-04-05fix #37 by fixing multiple, hard to track down typosBernhard Posselt
2013-04-04fixes mappers by using the correct status conditionBernhard Posselt
2013-04-04deleted old code that i forgot to deleteBernhard Posselt
2013-04-04move autopurge to itemblBernhard Posselt
2013-04-04autopurge all read items which are not starred if there are more than 1000Bernhard Posselt
2013-04-04autopurge all read items which are not starred if there are more than 1000Bernhard Posselt
2013-03-27fixed mark all unread serverside (was missing highestitemid, dont use lastmod...Bernhard Posselt
2013-03-26show title and author below feedBernhard Posselt
2013-03-26viewing the first 20 items is now possibleBernhard Posselt
2013-03-26added casting information for data objectsBernhard Posselt
2013-03-26fix referential integrityBernhard Posselt
2013-03-26also use feedid because feed + guid hash are unique togetherBernhard Posselt
2013-03-25remove prefixBernhard Posselt
an class="kt">long long start, unsigned long long end) { fprintf(stderr, " > SPEED: %u requests served in %0.2f seconds ( >>> %llu per second <<< )\n", requests, (end-start) / 1000000.0, (unsigned long long)requests * 1000000ULL / (end-start)); fprintf(stderr, " > DB : persons %llu, machines %llu, unique URLs %llu, accesses %llu, URLs: for persons %llu, for machines %llu\n", registry.persons_count, registry.machines_count, registry.urls_count, registry.usages_count, registry.persons_urls_count, registry.machines_urls_count); } (void) argc; (void) argv; uint32_t u, users = 1000000; uint32_t m, machines = 200000; uint32_t machines2 = machines * 2; char **users_guids = malloc(users * sizeof(char *)); char **machines_guids = malloc(machines2 * sizeof(char *)); char **machines_urls = malloc(machines2 * sizeof(char *)); unsigned long long start; registry_init(); fprintf(stderr, "Generating %u machine guids\n", machines2); for(m = 0; m < machines2 ;m++) { uuid_t uuid; machines_guids[m] = malloc(36+1); uuid_generate(uuid); uuid_unparse(uuid, machines_guids[m]); char buf[FILENAME_MAX + 1]; snprintfz(buf, FILENAME_MAX, "http://%u.netdata.rocks/", m+1); machines_urls[m] = strdup(buf); // fprintf(stderr, "\tmachine %u: '%s', url: '%s'\n", m + 1, machines_guids[m], machines_urls[m]); } start = timems(); fprintf(stderr, "\nGenerating %u users accessing %u machines\n", users, machines); m = 0; time_t now = time(NULL); for(u = 0; u < users ; u++) { if(++m == machines) m = 0; PERSON *p = registry_request_access(NULL, machines_guids[m], machines_urls[m], "test", now); users_guids[u] = p->guid; } print_stats(u, start, timems()); start = timems(); fprintf(stderr, "\nAll %u users accessing again the same %u servers\n", users, machines); m = 0; now = time(NULL); for(u = 0; u < users ; u++) { if(++m == machines) m = 0; PERSON *p = registry_request_access(users_guids[u], machines_guids[m], machines_urls[m], "test", now); if(p->guid != users_guids[u]) fprintf(stderr, "ERROR: expected to get user guid '%s' but git '%s'", users_guids[u], p->guid); } print_stats(u, start, timems()); start = timems(); fprintf(stderr, "\nAll %u users accessing a new server, out of the %u servers\n", users, machines); m = 1; now = time(NULL); for(u = 0; u < users ; u++) { if(++m == machines) m = 0; PERSON *p = registry_request_access(users_guids[u], machines_guids[m], machines_urls[m], "test", now); if(p->guid != users_guids[u]) fprintf(stderr, "ERROR: expected to get user guid '%s' but git '%s'", users_guids[u], p->guid); } print_stats(u, start, timems()); start = timems(); fprintf(stderr, "\n%u random users accessing a random server, out of the %u servers\n", users, machines); now = time(NULL); for(u = 0; u < users ; u++) { uint32_t tu = random() * users / RAND_MAX; uint32_t tm = random() * machines / RAND_MAX; PERSON *p = registry_request_access(users_guids[tu], machines_guids[tm], machines_urls[tm], "test", now); if(p->guid != users_guids[tu]) fprintf(stderr, "ERROR: expected to get user guid '%s' but git '%s'", users_guids[tu], p->guid); } print_stats(u, start, timems()); start = timems(); fprintf(stderr, "\n%u random users accessing a random server, out of %u servers\n", users, machines2); now = time(NULL); for(u = 0; u < users ; u++) { uint32_t tu = random() * users / RAND_MAX; uint32_t tm = random() * machines2 / RAND_MAX; PERSON *p = registry_request_access(users_guids[tu], machines_guids[tm], machines_urls[tm], "test", now); if(p->guid != users_guids[tu]) fprintf(stderr, "ERROR: expected to get user guid '%s' but git '%s'", users_guids[tu], p->guid); } print_stats(u, start, timems()); for(m = 0; m < 10; m++) { start = timems(); fprintf(stderr, "\n%u random user accesses to a random server, out of %u servers,\n > using 1/10000 with a random url, 1/1000 with a mismatched url\n", users * 2, machines2); now = time(NULL); for (u = 0; u < users * 2; u++) { uint32_t tu = random() * users / RAND_MAX; uint32_t tm = random() * machines2 / RAND_MAX; char *url = machines_urls[tm]; char buf[FILENAME_MAX + 1]; if (random() % 10000 == 1234) { snprintfz(buf, FILENAME_MAX, "http://random.%ld.netdata.rocks/", random()); url = buf; } else if (random() % 1000 == 123) url = machines_urls[random() * machines2 / RAND_MAX]; PERSON *p = registry_request_access(users_guids[tu], machines_guids[tm], url, "test", now); if (p->guid != users_guids[tu]) fprintf(stderr, "ERROR: expected to get user guid '%s' but git '%s'", users_guids[tu], p->guid); } print_stats(u, start, timems()); } fprintf(stderr, "\n\nSAVE\n"); start = timems(); registry_save(); print_stats(registry.persons_count, start, timems()); fprintf(stderr, "\n\nCLEANUP\n"); start = timems(); registry_free(); print_stats(registry.persons_count, start, timems()); return 0; } // ---------------------------------------------------------------------------- // TESTING int main(int argc, char **argv) { config_set_boolean("registry", "enabled", 1); //debug_flags = 0xFFFFFFFF; test1(argc, argv); exit(0); (void)argc; (void)argv; PERSON *p1, *p2; fprintf(stderr, "\n\nINITIALIZATION\n"); registry_init(); int i = 2; fprintf(stderr, "\n\nADDING ENTRY\n"); p1 = registry_request_access("2c95abd0-1542-11e6-8c66-00508db7e9c9", "7c173980-145c-11e6-b86f-00508db7e9c1", "http://localhost:19999/", "test", time(NULL)); if(0) while(i--) { #ifdef REGISTRY_STDOUT_DUMP fprintf(stderr, "\n\nADDING ENTRY\n"); #endif /* REGISTRY_STDOUT_DUMP */ p1 = registry_request_access(NULL, "7c173980-145c-11e6-b86f-00508db7e9c1", "http://localhost:19999/", "test", time(NULL)); #ifdef REGISTRY_STDOUT_DUMP fprintf(stderr, "\n\nADDING ANOTHER URL\n