Mar 13, 2019 - assets_Request

Native Ad Request Markup object

타불라 네이비트 광고의 Request 요청 처리안 스펙정의값

The Native Object defines the native advertising opportunity available for bid via this bidrequest.
The Taboola Open RTB will supply this as a JSON-encoded string.
Every Taboola inventory item will call for six assets to be returned in the response: A title, an image (for the thumbnail), brand name, description, the price of the product and a privacy link.
Out of the six only the first two are mandatory, and the others optional.
All are described in further details in the following sections.

Json 안에 String 화된 Json 이 다시 구현되어있는 구조.

Asset object - title

- Describes the need for the bid creative to contain a title. {"id":1,"required":1,"title":{"len":1500}} id : Unique asset ID, assigned by exchange. Typically a counter for the array
   - Value will be set to 1 required : Set to 1 if asset is required (exchange will not accept a bid without it)
   - Value will be set to 1 title : d Title object - contains a single field defining the maximal allowed length of the title:
    Field name: len
    Field type: Int
   - Will be set to 90 by default.

Asset object - img

  • Describes the need for the bid creative to contain an image, that will serve as the creative’s thumbnail. {“id”:2,”required”:1,”img”:{“type”:3,”wmin”:1,”hmin”:1}} id : Unique asset ID, assigned by exchange. Typically a counter for the array
    • Value will be set to 2 required : Set to 1 if asset is required (exchange will not accept a bid without it)
    • Value will be set to 1 img : img object will contain three (int type) fields: wmin - the minimum requested width of the image in pixels. hmin - the minimum requested height of the image in pixels type - the type ID of the image element supported by the publisher
    • Type value will always be set to 3 (“Large image preview for the ad”)

Asset object - brand name

  • Describes the need for the bid creative to contain a branding text. If no brand name will be supplied, the advertiser domain will be used by Taboola instead. {“id”:3,”required”:0,”data”:{“type”:1,”len”:200}} id : Unique asset ID, assigned by exchange. Typically a counter for the array
    • Value will be set to 3 required : Set to 1 if asset is required (exchange will not accept a bid without it)
    • Value will be set to 0 data : data object will contain two fields (of type int): Field name - type Field name - len
    • ‘type’ value will always be set to 1, which states ‘Sponsored By message where response should contain the brand name of the sponsor’ len represents the maximal allowed length for the brand name.

Asset object - description

Describes the need for the bid creative to contain a descriptive text. {“id”:4,”required”:0,”data”:{“type”:2,”len”:15000}}

id : Unique asset ID, assigned by exchange. Typically a counter for the array - Value will be set to 4 required : Set to 1 if asset is required (exchange will not accept a bid without it) - Value will be set to 0 data : data object will contain two fields (of type int): Field name - type Field name - len - ‘type’ value will always be set to 2, which states ‘Descriptive text associated with the product or service being advertised. Longer length of text in response may be truncated or ellipsed by the exchange’ len represents the maximal allowed length for the description.

Asset object - price

  • Describes the option for the bid creative to contain a price, in case the bidder is offering a product ad. {“id”:5,”required”:0,”data”:{“type”:6,”len”:60}}

id : Unique asset ID, assigned by exchange. Typically a counter for the array - Value will be set to 5 required : Set to 1 if asset is required (exchange will not accept a bid without it) - Value will be set to 0 data : data object will contain one field : Field name - type Field value - int - Value will always be set to 6, which states ‘Price for product / app / in-app purchase. Value should include currency symbol in localized format

  • In some cases the bidder might be willing to supply a link to its privacy policy opt out mechanism, as part of the creative. In case this asset is incorporated in the response, the Taboola exchange will use this link as opt-out parameters, which will be concatenated to a domain name agreed upon prior to setting up the RTB integration. The result is what the user will be redirected to when interacting with the Taboola AdChoices icon for that slot. For more details please contact Taboola product team. {“id”:6,”required”:0,”data”:{“type”:500}}

id : Unique asset ID, assigned by exchange. Typically a counter for the array - Value will be set to 6 required : Set to 1 if asset is required (exchange will not accept a bid without it) - Value will be set to 0 data : data object will contain one field: Field name - type Field value - string - Value will always be set to 500

Jan 30, 2019 - Anonymous

람다 vs 익명클래스 성능 확인

import java.util.function.DoubleBinaryOperator;
public class Main {
    private final DoubleBinaryOperator op;
    Main( DoubleBinaryOperator op) {
        this.op = op;
    }

    public static void main(String[] args) {

        long start = System.currentTimeMillis();

        for (int i = 0; i < 100000; i++) {
            new Main(new DoubleBinaryOperator() {
                @Override
                public double applyAsDouble(double x, double y) {
                    return x+y;
                }
            });
        }

        long end = System.currentTimeMillis();
        System.out.println(end - start);

        start = System.currentTimeMillis();
        for (int i = 0; i < 100000; i++) {
            new Main((x,y)->x+y);
        }
         end = System.currentTimeMillis();
        System.out.println(end - start);
    }
}

람다를 사용할 경우, 소스는 매우 간단하게 바뀝니다.

테스트를 위해, DoubleBinaryOperator 클래스를 import 받아 테스트했을 때,

new Main((x,y)->x+y);

람다는 단 한줄안에 처리되지만,

new Main(new DoubleBinaryOperator() {
    @Override
    public double applyAsDouble(double x, double y) {
        return x+y;
    }
});

익명클래스(anonymous class)를 사용하여 생성할 경우에는 상당히 복잡해보입니다. 하지만 속도를 확인했을 경우, anonymous class 로 생성해서 돌리는 경우가 람다식을 썻을 때보다 대략 3~8배 가량 빠른 것을 확인할 수 있습니다. 꼭 최신 기능이 더 나은 기능이란 것은 아니라고 생각합니다.

개발자들은 숨겨진 비용에 대해, 명확하게 알고 사용하는 것이 좋을 것이라고 생각합니다. 응답시간을 100ms 맞춰야하는 짧은 시간에서, 조금이라도 성능을 확인하고 적용하면, 별도의 Util 보다 hardcoding 형태로 바로 적용하는 것이 더 빠를 경우도 있어, 상황에 맡게 자신의 기술력을 적용하는 것이 어렵다는 걸 자주 느낍니다.

Jan 3, 2019 - netstat -na | grep 720 | grep ESTABLISHED

넷스탯, 네트워크 통계

외부와의 연결상태를 파악할 수 있습니다. 시스템과 연결된 여러가지 세션(session) 정보들을 확인할 수 있습니다. 개발자들은 보통 커넥션 풀을 확인하는 용도로 확인합니다.

SE 라면, 시스템 라우팅 테이블 확인, 네트워크 인터페이스 사용통계 확인, 마스커레이드 연결확인, 멀티케스팅 과 같은 현재 시스템의 네트워크에 관한 다양한 정보확인을 할 수 있는 유용한 네트워크 관리도구라고 합니다.

-a : --all 과 같으며 listen되는 소켓정보와 listen 되지 않는 소켓정보 모두 보여줍니다.
-n : --numeric 과 같으며 10진수의 수치정보로 결과를 출력합니다.
-r : --route 와 같으며 설정된 라우팅정보를 출력합니다.
-p : --program 과 같으며 실행되고 있는 각 프로그램과 PID 정보를 출력합니다.
-i : --interface=iface 와 같으며 모든 네트워크 인터페이스 정보를 출력합니다. 또는 특정 네트워크 인터페이스를 지정할 수도 있습니다.
-c : --continuous 와 같으며 netstat 결과를 연속적으로 출력합니다.
-l : --listening 과 같으며 현재 listen 되고 있는 소켓정보를 출력합니다.
-s : --statistics 와 같으며 각 프로토콜에 대한 통계정보를 출력합니다.

netstat -rn : route 와 같은 기능합니다. netstat -an : 모든 소켓을 보여줍니다. netstat -atp : 열려진 포트를 사용하고 있는 프로세스를 확인합니다. netstat -s : 각각의 프로토콜의 사용 통계를 확인합니다.

[WAS-03:root]/root>#netstat -na | grep 720 | grep ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:41956            xxx.xxx.xxx.103:7205           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:46042            xxx.xxx.xxx.102:7202           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:40238            xxx.xxx.xxx.102:7206           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:51886            xxx.xxx.xxx.102:7208           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:42588            xxx.xxx.xxx.103:7205           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:44846            xxx.xxx.xxx.103:7207           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:52202            xxx.xxx.xxx.103:7201           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:54546            xxx.xxx.xxx.102:7200           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:54964            xxx.xxx.xxx.102:7200           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:49862            xxx.xxx.xxx.102:7204           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:53268            xxx.xxx.xxx.102:7200           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:43196            xxx.xxx.xxx.103:7207           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:50626            xxx.xxx.xxx.102:7204           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:48736            xxx.xxx.xxx.102:7200           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:50086            xxx.xxx.xxx.102:7208           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:60356            xxx.xxx.xxx.103:7201           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:33794            xxx.xxx.xxx.103:7201           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:41388            xxx.xxx.xxx.102:7206           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:45390            xxx.xxx.xxx.102:7202           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:44728            xxx.xxx.xxx.103:7209           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:37258            xxx.xxx.xxx.102:7202           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:59658            xxx.xxx.xxx.103:7203           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:44726            xxx.xxx.xxx.103:7209           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:42756            xxx.xxx.xxx.103:7209           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:59744            xxx.xxx.xxx.103:7203           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:58458            xxx.xxx.xxx.103:7203           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:42052            xxx.xxx.xxx.102:7206           ESTABLISHED
tcp        0      0 xxx.xxx.xxx.3:42590            xxx.xxx.xxx.103:7205           ESTABLISHED

netstat -an 를 사용하여 현재 720X 포트를 사용하는 ESTABLISHED된 소켓을 확인할 수 있습니다. CLOSE_WAIT 나 ESTABLISHED, TIME_WAIT 처리를 정상적으로 하고 있는지 확인합니다.