Browse Source

Add names to each file

master
Martins Eglitis 5 months ago
parent
commit
99bb8d3bdc
19 changed files with 14 additions and 2771 deletions
  1. +1
    -1
      README.md
  2. +1
    -0
      aggregate/aggregate.go
  3. +1
    -0
      client/main.go
  4. BIN
      docs/HW1.pdf
  5. BIN
      docs/ME_SK_Project_Usenet_Newsgroups.pdf
  6. +0
    -47
      docs/presentation.txt
  7. +0
    -35
      docs/prof_cpu.txt
  8. +0
    -2688
      docs/prof_mem.svg
  9. +1
    -0
      helpers/helpers.go
  10. +1
    -0
      main.go
  11. +1
    -0
      periodic/periodic.go
  12. +1
    -0
      scripts/main.go
  13. +1
    -0
      send/send.go
  14. +1
    -0
      structs/structs.go
  15. +1
    -0
      transport/transport.go
  16. +1
    -0
      web/static/main.css
  17. +1
    -0
      web/static/main.js
  18. +1
    -0
      web/templates/index.html
  19. +1
    -0
      web/web.go

+ 1
- 1
README.md View File

@@ -1,4 +1,4 @@
# go-peerster
# peerster

Peerster is a decentralized system for sending messages. It is inspired by [Usenet](https://en.wikipedia.org/wiki/Usenet) - an electronic bulletin board with no central authority, a predecessor of modern social networks and applications.



+ 1
- 0
aggregate/aggregate.go View File

@@ -1,3 +1,4 @@
//Author: Martins Eglitis
package aggregate

import (


+ 1
- 0
client/main.go View File

@@ -1,3 +1,4 @@
//Author: Martins Eglitis
package main

import (


BIN
docs/HW1.pdf View File


BIN
docs/ME_SK_Project_Usenet_Newsgroups.pdf View File


+ 0
- 47
docs/presentation.txt View File

@@ -1,47 +0,0 @@
1.
Problem - spam.
- See proposal for usenet history.

2.
Solution - newsgroups.
- See proposal for usenet fundamental concepts.

3.
Implementaion - peerster.
- Show the changes to the gossip protocol.
- Flags we introduced, e.g. I added --filterIn for showing/not showing "spam"
and --filterOut for checking if the receiving peer belongs to the groups given in the
rumour message.

Demo.
- Use screen recorder.

4.
Problems
- Spam is relative to each peerster / user
- Newgroups take additional space and harder to maintain due to being identified by strings
- Hard to measure impact of each spam message on system
- Hard to trace each message
- Impossible to prevent churn, e.g. loosing messages / newgroups

5.
Results
- Updated gossip protocol to support newsgroups
- Implemented the underlying filtering features on two different peersters
- Peersters are able to input / output relevant information thus preventing spam
- Tested on a peerster ring of 4 peerster each sending a message each 1ms
- Performance tests (CPU and memory) performed to find problem areas
- Updated web and CLI clients

6.
Lessons learned
- Use go tools like pprof for performance tests
- Use go fmt with git hooks for automating code style
- Always, always keep your code clean
- Useful comments are good

7.
Future improvements
- Unit tests (go test)
- Websockets (gorilla websocket)
- Tracing (zipkin)

+ 0
- 35
docs/prof_cpu.txt View File

@@ -1,35 +0,0 @@
go tool pprof http://localhost:6060/debug/pprof/profile\?seconds\=180
Fetching profile over HTTP from http://localhost:6060/debug/pprof/profile?seconds=180
Saved profile in /home/martins/pprof/pprof.main.samples.cpu.002.pb.gz
File: main
Type: cpu
Time: Dec 12, 2019 at 7:50pm (CET)
Duration: 3mins, Total samples = 3.37s ( 1.87%)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) top 100
Showing nodes accounting for 3.11s, 92.28% of 3.37s total
Dropped 56 nodes (cum <= 0.02s)
Showing top 100 nodes out of 123
flat flat% sum% cum cum%
1.13s 33.53% 33.53% 1.34s 39.76% github.com/sitilge/Peerster/periodic.Pulse.func1
0.41s 12.17% 45.70% 0.50s 14.84% github.com/sitilge/Peerster/helpers.AckStatus
0.30s 8.90% 54.60% 0.32s 9.50% syscall.Syscall
0.23s 6.82% 61.42% 0.23s 6.82% memeqbody
0.20s 5.93% 67.36% 0.20s 5.93% runtime.futex
0.18s 5.34% 72.70% 0.18s 5.34% runtime.usleep
0.07s 2.08% 74.78% 0.07s 2.08% runtime.epollwait
0.06s 1.78% 76.56% 0.06s 1.78% runtime.memequal
0.05s 1.48% 78.04% 0.05s 1.48% syscall.Syscall6
0.03s 0.89% 78.93% 0.03s 0.89% runtime.lock
0.03s 0.89% 79.82% 0.03s 0.89% runtime.madvise
0.03s 0.89% 80.71% 0.08s 2.37% runtime.mallocgc
0.03s 0.89% 81.60% 0.03s 0.89% runtime.scanobject
0.03s 0.89% 82.49% 0.30s 8.90% runtime.sysmon
0.02s 0.59% 83.09% 1.19s 35.31% github.com/sitilge/Peerster/aggregate.Packet
0.02s 0.59% 83.68% 0.02s 0.59% runtime.(*mcache).prepareForSweep
0.02s 0.59% 84.27% 0.07s 2.08% runtime.gentraceback
0.02s 0.59% 84.87% 0.03s 0.89% runtime.heapBitsSetType
0.02s 0.59% 85.46% 0.09s 2.67% runtime.netpoll
0.02s 0.59% 86.05% 0.02s 0.59% runtime.procPin
0.02s 0.59% 86.65% 0.03s 0.89% runtime.step
0.01s 0.3% 86.94% 0.04s 1.19% fmt.(*pp).doPrintf

+ 0
- 2688
docs/prof_mem.svg
File diff suppressed because it is too large
View File


+ 1
- 0
helpers/helpers.go View File

@@ -1,3 +1,4 @@
//Author: Martins Eglitis
package helpers

import (


+ 1
- 0
main.go View File

@@ -1,3 +1,4 @@
//Author: Martins Eglitis
package main

import (


+ 1
- 0
periodic/periodic.go View File

@@ -1,3 +1,4 @@
//Author: Martins Eglitis
package periodic

import (


+ 1
- 0
scripts/main.go View File

@@ -1,3 +1,4 @@
//Author: Martins Eglitis
package main

import (


+ 1
- 0
send/send.go View File

@@ -1,3 +1,4 @@
//Author: Martins Eglitis
package send

import (


+ 1
- 0
structs/structs.go View File

@@ -1,3 +1,4 @@
//Author: Martins Eglitis
package structs

import (


+ 1
- 0
transport/transport.go View File

@@ -1,3 +1,4 @@
//Author: Martins Eglitis
package transport

import (


+ 1
- 0
web/static/main.css View File

@@ -1,3 +1,4 @@
/*Author: Martins Eglitis*/
html, body {
height: 100%;
}


+ 1
- 0
web/static/main.js View File

@@ -1,3 +1,4 @@
// Author: Martins Eglitis
$(function () {
$("#submitConfig").on("click", function () {
$.ajax({


+ 1
- 0
web/templates/index.html View File

@@ -1,6 +1,7 @@
{{define "index"}}
<!doctype html>
<html lang="en">
<!--Author: Martins Eglitis-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">


+ 1
- 0
web/web.go View File

@@ -1,3 +1,4 @@
//Author: Martins Eglitis
package web

import (


Loading…
Cancel
Save